Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
<1806 - 부분 합>
2-1) start(시작)와 end(끝) 초기화, len(부분 배열의 최소 길이)과 sum(시작과 끝 배열의 합) 선언
2-2) start가 end와 같거나 end가 n보다 작거나 같을 때까지 반복
2-2-1) 합이 목표 합보다 작을 경우
2-2-1-1) 현재 end위치의 값을 sum에 더하고 end증가
2-2-2) 합이 목표 합볻 크거나 같을 경우
2-2-2-1) 현재 윈도우의 길이(end - start)와 len을 비교하여 더 작은 값을 len에 저장
2-2-2-2) start 위치의 값을 sum에서 빼고 start 증가
<2531 - 회전 초밥>
7-1) 윈도우를 오른쪽으로 한 칸씩 이동
7-2) start를 줄이고 해당 초밥 제거
7-2-1) 만약 해당 초밥이 더 이상 먹히지 않았다면 result에서 종류 수 -1
7-3) end에 새로운 초밥 추가 종류 수 +1
7-4) 각 단계에서 max 업데이트, 최대 초밥 종류 계산
<16472 - 고냥이>
3-1) 문자열의 각 문자를 하나씩 추가하면서 cnt 증가
3-1-1) 만약 end가 가리키는 문자가 처음 등장했다면 cnt를 증가
3-2) cnt가 N을 초과하면 start를 오른쪽으로 이동, cnt를 감소시켜 N 이하로 만들기
3-2-1) 더 이상 포함하지 않게 된 문자는 arr에서 수를 감소
3-2-2) 해당 문자가 윈도우에서 완전히 없어지면 cnt 감소
3-3) 현재 윈도우의 길이를 a와 비교하여 더 큰 값을 a에 저장