-
Notifications
You must be signed in to change notification settings - Fork 7
[Berrnuda] 24.12.03 #112
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
Merged
[Berrnuda] 24.12.03 #112
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.
📌 푼 문제
📝 간단한 풀이 과정
7 Reverse integer
x를 문자형으로 바꾸고 한글자식 나눠서 자른뒤
reverse시키고 다시 숫자형으로 바꾸는 방식입니다.sign이란 변수에 양수인지 음수인지 담아두고Math.pow메소드로 32비트 확인을 하는 코드입니다.743 Network Delay Time
힙을 사용하지 않고 풀어봤습니다.
times를 리스트 형태로 저장하고
dist변수로 시작 노드의 거리를 설정한 뒤방문하지 않은 노드중에서 최소거리의 노드를 찾고 방문처리한 다음 그 노드와 연결된 노드의 거리를 갱신하는 코드입니다.
39 Combination Sum
솔루션 보니 재귀함수 방식으로 푼게 좀 많아서 따라 풀어보려다 뭔가 머리아파서 그냥 반복문으로 구현해봤습니다.
조합, 합, 시작 인덱스를 저장해둘 스택을 선언하고
target과 비교해가며 다음 후보를 탐색하는 반복문입니다.2013 Detect Squares
add 메서드는
/을 문자열 키로 잡고ptsCount라는 배열에 추가하는 메서드입니다.count 메서드는 저장된
p을 순회하며q와 정사각형을 만들수 있는지 확인하는 메서드입니다.57 Insert Interval
기존 배열에 새 구간을 추가한뒤 시작시간을 기준으로 정렬하고
res라는 변수에 결과배열을 저장하고 첫번째 구간을 추가해둡니다.그리고
intervals배열을 순회하면서 조건문을 통해 겹치면 업데이트하는 반복문 입니다.