-
-
Notifications
You must be signed in to change notification settings - Fork 195
[Tessa1217] Week 07 Solutions #1463
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
Conversation
int right = 0; | ||
|
||
// 알파벳 (대소문자), 숫자, 특수문자, 공백 | ||
boolean[] visited = new boolean[128]; |
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.
visited를 고정된 크기의 boolean 배열로 처리해서, 공간을 항상 O(1)로 유지하는 점이 특히 인상 깊었습니다.
문자열 길이에 상관없이 일정한 성능을 유지할 수 있어서 좋은 접근인 것 같아요!
|
||
ListNode prev = head; | ||
ListNode next = prev.next; | ||
head.next = null; |
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.
head.next = null 부분이 처음엔 낯설고 직관적으로 와닿지 않아서 한참을 살펴보았습니다. 하지만, 흐름을 따라가며 이해하니 로직이 깔끔하게 구성된 점이 인상 깊었습니다.
// land라면 | ||
if (grid[i][j] == '1') { | ||
|
||
// bfs로 섬 탐색 |
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.
dfs 또는 bfs 하나만 선택해서 사용하는 것으로 주석 처리하면 어떨까합니다.
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.
앗 bfs랑 dfs 성능 비교해본다고 올렸다가 ㅎㅎ 주석을 다 풀고 올렸네요. 감사합니다!
답안 제출 문제
작성자 체크 리스트
In Review
로 설정해주세요.검토자 체크 리스트
Important
본인 답안 제출 뿐만 아니라 다른 분 PR 하나 이상을 반드시 검토를 해주셔야 합니다!