-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Week10] String - 규리 #64
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
저번에도 느꼈지만 코드가 가독성이 좋은 것 같아요👍이번주도 수고하셨습니다!
BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); | ||
StringBuilder sb = new StringBuilder(); | ||
|
||
char[][] arr = new char[5][15]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오...최대 15개의 글자들이라고 문제에 나와있었군요!! 저는 입력 받은 문자열 중에 최대값 따로 구해줬는데 그럴 필요가 없었네요💦
arr[i] = br.readLine(); | ||
} | ||
|
||
while (sb.length() <= 15){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
한 줄의 글자 수가 15여서, sb는 최대 15*5가 될 수 있어서 틀린거 아닐까요?! 그리고 밑에 127번째 줄에서 현재 인덱스보다 문자열 길이가 큰지 검사해주고 sb에 append해주기 때문에 해당 while조건문이 없어도 맞긴 할 거 같아요!
System.out.println("Yes"); | ||
} else { | ||
System.out.println("No"); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
t에 대한 문자열을 for문으로 돌아주면서 s 인덱스만 증가시키면서 검사하는게 깔끔하네요!
} | ||
return true; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
코드 진짜 깔끔하고 읽기도 좋네요! position객체로 left, right묶어주는거, isPalindrome을 boolean값으로 리턴해서 ||로 처리하는것도 isPalindrome함수 재사용성이 되게 높은거 같아서 잘보고 갑니당
No description provided.