Merged
Conversation
JooKangsan
reviewed
Jan 23, 2025
Collaborator
JooKangsan
left a comment
There was a problem hiding this comment.
전체적으로 너무 깔끔한 코드였습니다!! 잘봤습니다!
Moonjonghoo/queue/순서쌍의_개수.js
Outdated
Collaborator
There was a problem hiding this comment.
Math.sqrt(n) 생각도 못하고 있었는데 감사합니다!
Moonjonghoo/queue/점의_위치_구하기.js
Outdated
JooKangsan
approved these changes
Jan 23, 2025
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.
📌 푼 문제
문제이름 문제링크
순서쌍의 개수 https://school.programmers.co.kr/learn/courses/30/lessons/120836
점의 위치 구하기 https://school.programmers.co.kr/learn/courses/30/lessons/120841
로그인 성공? https://school.programmers.co.kr/learn/courses/30/lessons/120883
특이한 정렬 https://school.programmers.co.kr/learn/courses/30/lessons/120880
프로세스 https://school.programmers.co.kr/learn/courses/30/lessons/42587
📝 간단한 풀이 과정
순서쌍의개수
주어진 정수 n의 약수 중에서 (a, b) 형태로 곱했을 때 a * b = n이 되는 모든 순서쌍의 개수를 구하는 문제입니다.
핵심 아이디어
1부터 √n까지의 숫자만 탐색하여 약수를 확인하고, 각 약수에 대해 (a, b) 쌍을 찾는 방식으로 해결
점의 위치 구하기
핵심 아이디어
x, y의 부호를 기준으로 사분면을 결정
각각의 경우를 조건문으로 분기하여 사분면 번호를 반환하도록 구현했습니다.
로그인 성공?
특이한 정렬
핵심 아이디어
절대값 거리 계산: 각 숫자와 기준값 n 간의 거리(Math.abs(a - n))를 계산하여 정렬 기준으로 사용.
거리가 같으면 숫자 크기(b - a)로 정렬.
거리가 다르면 거리 기준으로 오름차순(diffA - diffB) 정렬.
프로세스
** 핵심 아이디어 **
priorities 배열을 큐처럼 활용하여 구현했고, some() 메서드를 통해 높은 우선순위를 구별했습니다.