-
Notifications
You must be signed in to change notification settings - Fork 126
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
[ysle0] Week2 #742
[ysle0] Week2 #742
Conversation
@ysle0 님 안녕하세요! |
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.
고생하셨습니다~ go를 덕분에 처음 리뷰 했습니다 ㅎㅎㅎ
valid-anagram/ysle0.go
Outdated
if !ok { | ||
return false | ||
} |
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.
밑에서 포문으로 한번 걸러주는 로직 덕분에 이 조건문은 없어도 되는 것 같습니다~
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.
@taewanseoul
극단적인 경우엔 해당 조건문이 상당한 양의 연산을 줄일 수 있습니다
// 예
s = "a...a" // (길이 5 * 10^4)
t = "b...b" // (길이 5 * 10^4)
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.
@ysle0
isAnagram
함수의 body 가장 앞단에 아래와 같은 로직도 있으면 좋을 것 같네요 :)
func isAnagram(s string, t string) bool {
if len(s) != len(t) {
return false
}
...
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.
아 그렇겠네요 경계검사 조건 피드백 감사합니다!
ret = append(ret, ret[i-1]+ret[i-2]) | ||
} | ||
|
||
ret = ret[len(ret)-2:] |
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.
javascript의 slice 메소드가 이렇게 다르게 생겼군요!
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.
네.. 저도 처음에 이렇게 slicing 하는 것 보고 되게 신기했었어요 ㅎㅎ
아직 solving 상태로 되어 있으셨군요...! 제가 모르고 리뷰 했습니다. 죄송합니다! |
답안 제출 문제
체크 리스트
In Review
로 설정해주세요.