Skip to content
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

Merged
merged 4 commits into from
Dec 28, 2024
Merged

[YeomChaeeun] Week 3 #774

merged 4 commits into from
Dec 28, 2024

Conversation

YeomChaeeun
Copy link
Contributor

@YeomChaeeun YeomChaeeun commented Dec 24, 2024

답안 제출 문제

체크 리스트

  • 우측 메뉴에서 PR을 Projects에 추가해주세요.
  • Projects의 오른쪽 버튼(▼)을 눌러 확장한 뒤, Week를 현재 주차로 설정해주세요.
  • 바로 앞에 PR을 열어주신 분을 코드 검토자로 지정해주세요.
  • 문제를 모두 푸시면 프로젝트에서 StatusIn Review로 설정해주세요.
  • 코드 검토자 1분 이상으로부터 승인을 받으셨다면 PR을 병합해주세요.

@YeomChaeeun YeomChaeeun requested a review from a team as a code owner December 24, 2024 08:30
@github-actions github-actions bot added the ts label Dec 24, 2024
@YeomChaeeun YeomChaeeun requested a review from ekgns33 December 24, 2024 08:31
* @param nums
* @param target
*/
function twoSum(nums: number[], target: number): number[] {
Copy link
Contributor

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('')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

요 함수의 시간복잡도가 어떻게될까요? 시간복잡도 계산시에 언어에서 제공하는 함수의 시간복잡도도 고려해보시면 좋을 것 같아요!

Copy link
Contributor Author

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) 로 처리되는걸 알게되었습니다!
내장 함수에 대한 복잡도는 크게 고려하지 않았었는데 알려주셔서 감사합니다!😊

Copy link
Contributor

@ekgns33 ekgns33 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다!

@YeomChaeeun YeomChaeeun merged commit 4fe8ea0 into DaleStudy:main Dec 28, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Completed
Development

Successfully merging this pull request may close these issues.

2 participants