-
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
[Jeehay28] WEEK 05 #858
base: main
Are you sure you want to change the base?
[Jeehay28] WEEK 05 #858
Conversation
// let obj = {}; | ||
|
||
// for (const str of strs) { | ||
// const key = sorted(str); |
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.
lower-case alphabet 만 입력으로 주어지기 때문에 sort를 했을 때 같은 anagram이라면 같은 키임을 활용하셨군요! 👍
const arr = new Array(26).fill(0); | ||
|
||
for (const ch of str) { | ||
const idx = ch.charCodeAt() - "a".charCodeAt(); |
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.
알파벳만 사용할때 유용한 것 같습니다! js에서는 charCodeAt
이라는 메소드로 형변환을 해줘야하나요? 🤔
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.
charCodeAt()은 문자열에서 특정 문자의 Unicode 값을 숫자로 반환하는 메소드입니다.
문자를 숫자로 바꾸는 역할을 해서 형변환이라고 생각할 수 있지만, 이보다는 문자 코드 값을 읽는 메소드라고 생각하시면 좋을 것 같습니다.
return profitMax; | ||
}; | ||
|
||
// Why Constants Are Ignored in Big-O |
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.
빅O 노테이션에 대해서 정리해주셨군요 감사합니다 :)
답안 제출 문제
체크 리스트
In Review
로 설정해주세요.