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

[선재] WEEK07 문제풀이 #493

Merged
merged 6 commits into from
Sep 28, 2024
Merged

[선재] WEEK07 문제풀이 #493

merged 6 commits into from
Sep 28, 2024

Conversation

Sunjae95
Copy link
Contributor

@Sunjae95 Sunjae95 commented Sep 24, 2024

답안 제출 문제

체크 리스트

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

@Sunjae95 Sunjae95 requested a review from HC-kang September 24, 2024 05:31
@Sunjae95 Sunjae95 self-assigned this Sep 24, 2024
@github-actions github-actions bot added the js label Sep 24, 2024
@Sunjae95 Sunjae95 marked this pull request as ready for review September 24, 2024 05:32
@Sunjae95 Sunjae95 requested a review from a team as a code owner September 24, 2024 05:32
Copy link
Contributor

@bky373 bky373 left a comment

Choose a reason for hiding this comment

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

brainstorming 을 작성해주셔서 코드를 읽는 데 도움이 되었습니다!
이번 한 주도 고생많으셨습니다!

Copy link
Contributor

@HC-kang HC-kang left a comment

Choose a reason for hiding this comment

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

이번 한 주도 고생많으셨어요 @Sunjae95 님!
항상 코드 잘 보고 있습니다!

*/
var setZeroes = function (matrix) {
const stack = [];
const memo = { row: new Set(), column: new Set() };
Copy link
Contributor

Choose a reason for hiding this comment

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

stack이나 memo중 하나만 사용하셨어도 되지 않았을까요? 최적화를 위해 두 가지를 모두 사용하신걸까요?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

맞아요. 동일한 크기인 matrix를 만들어서 memo를 활용하는 방법도 가능하나, stack이나 queue와 같이 0인지점을 저장하고 모두 소모하는 방식이 조금이라도 공간을 덜 사용하지 않을까 싶어서 선택했어요.

var reverseList = function (head) {
let answer = null;

const search = (target) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

search라는 함수 네이밍은 추후 오해의 소지가 있지 않을까 싶어요.
buildReverseList 등이 좀 더 명확하게 내부 구현을 표현하지 않을까요?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

오 reverseList 단어가 들어가니 더 명시적이네요! 변수명이 제일어렵네요 😂

@Sunjae95 Sunjae95 merged commit c25a352 into DaleStudy:main Sep 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
No open projects
Status: Completed
Development

Successfully merging this pull request may close these issues.

4 participants