-
-
Notifications
You must be signed in to change notification settings - Fork 195
[gomgom22] Week1 #687
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
[gomgom22] Week1 #687
Conversation
contains-duplicate/YJason-K.ts
Outdated
let unique: Set<number> = new Set([]); | ||
for (const num of nums) { | ||
if (unique.has(num)) { | ||
return true | ||
} else { | ||
unique.add(num) | ||
} | ||
} | ||
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.
아래와 같이 Set과 List의 길이를 비교하는 방법도 참고하시면 좋을것 같습니다 :)
new Set(nums).size !== nums.length;
valid-palindrome/YJason-K.ts
Outdated
* @param {string} s - 정제할 물자열 | ||
* @returns {string} - 소문자 알파벳과 숫자로 이루어진 문자열 | ||
*/ | ||
const refinePhrase = (s:string) : string => s.toLowerCase().replace(/[^a-z0-9]/g, ''); |
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.
코드 가독성은 물론 자세한 설명이 코드 리뷰하는데 너무나도 편하게 진행할 수 있었습니다.
남은 14주도 파이팅입니다!
안녕하세요 @Yjason-K 님! |
답안 제출 문제
체크 리스트
In Review
로 설정해주세요.