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

[선재] WEEK 03 #391

Merged
merged 6 commits into from
Aug 30, 2024
Merged

[선재] WEEK 03 #391

merged 6 commits into from
Aug 30, 2024

Conversation

Sunjae95
Copy link
Contributor

@Sunjae95 Sunjae95 commented Aug 27, 2024

답안 제출 문제

체크 리스트

  • PR을 프로젝트에 추가하고 Week를 현재 주차로 설정해주세요.
  • 바로 앞에 PR을 열어주신 분을 코드 검토자로 지정해주세요.
  • 문제를 모두 푸시면 프로젝트에서 Status를 In Review로 설정해주세요.
  • 코드 검토자 1분 이상으로부터 승인을 받으셨다면 PR을 병합해주세요.

@Sunjae95 Sunjae95 self-assigned this Aug 27, 2024
@Sunjae95 Sunjae95 requested a review from jdalma August 27, 2024 10:51
@Sunjae95 Sunjae95 marked this pull request as ready for review August 27, 2024 10:51
@Sunjae95 Sunjae95 requested a review from a team as a code owner August 27, 2024 10:51
@Sunjae95 Sunjae95 added the js label Aug 27, 2024
Copy link
Contributor

@DaleSeo DaleSeo left a comment

Choose a reason for hiding this comment

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

복잡도 분석에 대한 피드백이 있지만 승인하는데 문제가 없는 것 같습니다. 수고 많으셨습니다!

Comment on lines +23 to +53
class CustomQueue {
constructor() {
this.front = null;
this.rear = null;
this.size = 0;
}

push(val) {
const node = new Node(val);

if (this.size === 0) {
this.front = node;
this.rear = node;
} else {
this.rear.next = node;
this.rear = node;
}

this.size++;
}

pop() {
if (this.size === 0) return null;
const node = this.front;
this.front = this.front.next;
this.size--;
if (this.size === 0) this.rear = null;

return node.value;
}
}
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.

맞아요 ㅠㅠ
자바스크립트는 자료구조가 많이 빈약한 언어라 따로 구현할수 밖에 없더라구요...
그래도 이렇게 구현�하니 자료구조 경험치가 쌓이는거 같아서 좋네요 :)

/**
* @description brainstorming 1 solve
* time complexity: O(n^2)
* space complexity: O(n)
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.

nums 자체가 계산에서 존재해서 공간복잡도가 O(n)라고 착각했네요. 계산중 사용하는 공간은 공간이 2인 배열이기에 공간복잡도는 O(1)이 되겠네요!

Copy link
Member

@jdalma jdalma left a comment

Choose a reason for hiding this comment

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

수고하셨습니다!

Comment on lines +3 to +11
* brainstorming:
* 1. asc sort + division calculate
* 2. bfs + memoization
*
* strategy:
* bfs + memoization
*
* reason:
* Tried with brainstorming 1 but test case is false
Copy link
Member

Choose a reason for hiding this comment

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

이런 내용 정말 좋은 것 같네요 ㅎㅎ 저도 작성해봐야겠네요

}

var coinChange = function (coins, amount) {
const queue = new CustomQueue();
Copy link
Member

Choose a reason for hiding this comment

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

저는 개인적으로 DP를 굉장히 못 풀어서 DP로 풀 수 있는 문제같으면 답안을 꼭 참고하는 편입니다 ㅎㅎ
이 문제는 DP에서 베이직한 문제라고 소개되고 있어서 괜찮으시면 해설 영상 추천드려요 혹시 DP에 익숙하시면 신경안쓰셔도 됩니당 ㅎㅎ

Copy link
Contributor Author

Choose a reason for hiding this comment

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

DP 초보인데 레퍼런스 감사합니다!
다양한 방법으로 생각하면서 풀어봐야겠네요!

@Sunjae95 Sunjae95 merged commit ec9da38 into DaleStudy:main Aug 30, 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.

3 participants