-
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
[YeomChaeeun] Week 3 #774
[YeomChaeeun] Week 3 #774
Conversation
* @param nums | ||
* @param target | ||
*/ | ||
function twoSum(nums: number[], target: number): number[] { |
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 reverseBits(n: number): number { | ||
// 2진수 배열로 변환 | ||
let arr = n.toString(2).split('') |
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.
안녕하세요! javaScript toString() 메서드에 대해 찾아보았는데요!
숫자인 경우 - O(log n), 배열 또는 객체인 경우 - O(n) 로 처리되는걸 알게되었습니다!
내장 함수에 대한 복잡도는 크게 고려하지 않았었는데 알려주셔서 감사합니다!😊
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.
고생하셨습니다!
답안 제출 문제
체크 리스트
In Review
로 설정해주세요.