-
-
Notifications
You must be signed in to change notification settings - Fork 247
[phenomenal_star_75309] #677
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
Conversation
파일명(suhacs.js)과 제 GitHub 아이디를 통일했는데 왜 계속 오류가 뜨는걸까요ㅜㅜ |
안녕하세요 @suhacs 님! |
해결됐습니다. 감사합니다~! |
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.
@suhacs 님 첫주 고생하셨습니다.
다만 풀이가 누락된 부분이 있는 것 같아요. 해당 내용 수정해주시면 다시 확인하겠습니다!
const numLength = nums.length; | ||
return numLength === setLength ? false : true; | ||
} | ||
console.log(containsDuplicate([1, 1, 1, 3, 3, 4, 3, 2, 4, 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.
제출시에는 확인을 위한 로그는 제거해주시는게 좋을 것 같아요! 🧹
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.
네 알겠습니다 !!
function containsDuplicate(nums) { | ||
const setLength = [...new Set(nums)].length; | ||
const numLength = nums.length; | ||
return numLength === setLength ? false : 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.
2line: new Set(nums).size !== nums.length
4line: numLength !== setLength
이후로도 더 간략화 할 수 있어 보이는데, 혹시 시간이 가능하시다면 한번 해보시는건 어떨까요?
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.
function containDuplicate2(nums) {
return nums.length !== new Set(nums).size;
}
이렇게 하니까 더 간단해지네요..!!!피드백 감사합니다~~!
element_qty.push({ [num]: count }); | ||
} | ||
Object.keys(element_qty).forEach((key) => element_qty[key]); | ||
} |
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.
회사에서 시간날때 풀다가, 집에서 마저 풀려고 커밋 해놓은건데 미완성인 상태로 올려버렸네요. 다음부터 유의하겠습니다 !
function isValidPalindrome(text) { | ||
let refinedTxt = text | ||
.replaceAll(/[^a-zA-Z0-9]/g, "") | ||
.replaceAll(" ", "") |
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.
.replaceAll(/[^a-zA-Z0-9]/g, "")
에서 이미 충분하게 replaceAll(" ", "")
까지 처리될것으로 보여요
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.
네 피드백 감사합니다 !!
.replaceAll(/[^a-zA-Z0-9]/g, "") | ||
.replaceAll(" ", "") | ||
.toLowerCase(); | ||
console.log(refinedTxt === [...refinedTxt].reverse().join("") ? true : 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.
불필요한 로그네요! 🧹
.replaceAll(" ", "") | ||
.toLowerCase(); | ||
console.log(refinedTxt === [...refinedTxt].reverse().join("") ? true : false); | ||
return refinedTxt === [...refinedTxt].reverse().join("") ? true : 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.
return refinedTxt === [...refinedTxt].reverse().join("")
로 충분해 보입니다!
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.
아 그렇네요 감사합니다 !!
네 문제풀이 다음과 같이 완료하였습니다!! function top_k_frequent_element(numArr, k) { const sortedArray = element_qty.sort((a, b) => { const topKeys = sortedArray.slice(0, k).map((obj) => Object.keys(obj)[0]); |
답안 제출 문제
체크 리스트
In Review
로 설정해주세요.