Merged
Conversation
oh-chaeyeon
approved these changes
Jan 21, 2025
Collaborator
oh-chaeyeon
left a comment
There was a problem hiding this comment.
전체적으로 가독성 좋게 문제를 풀어나가신 것 같아 쉽게 코드를 이해할 수 있었습니다!! 이번 한주도 수고하셨습니다🙂
Collaborator
There was a problem hiding this comment.
심화문제는 풀지 못해서 리뷰하면서 문제도 처음보게 되었는데, 문제 이해하는 데도 오래걸렸는데 코드리뷰하면서 some메서드 활용하면서 간단히 구현하는 부분 등 많이 배우고 갑니다👍
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.
📌 푼 문제
📝 간단한 풀이 과정
순서쌍의 개수
주어진 숫자 n에 대해 1부터 n까지 순회하며, 약수를 찾아 개수를 세는 방식으로 해결했습니다.
점의 위치 구하기
주어진 점의 x좌표(dot[0])와 y좌표(dot[1])의 부호를 비교하여, 각각의 사분면(1, 2, 3, 4)을 조건문으로 판단하고 해당 값을 반환하는 방식으로 해결했습니다.
로그인 성공?
주어진 배열을 순회하면서 db 배열의 i번째 행의 요소값이 id_pw[0]의 요소와 id_pw[1]의 요소가 모두 일치하면 "login", id_pw[0]만 일치하면 "wrong pw", 둘 다 일치하지 않다면 "fail"을 반환하는 방식을 해결했습니다.
카드 뭉치
목표 단어 배열(goal)을 순서대로 확인하며, 각 단어가 cards1이나 cards2의 첫 번째 단어와 일치하면 해당 단어를 제거하는 방식으로 해결했습니다.
햄버거 만들기
ingredient 배열을 순회하며, 빈 스택 배열 burger 에 재료를 추가하고 마지막 4개의 재료가 (1, 2, 3, 1) 순서라면 이를 제거하고 햄버거 개수를 증가시키는 방식으로 해결했습니다.
프로세스
주어진 priorities 배열의 요소를 { 우선순위, 인덱스 } 객체를 요소로 가진 새로운 queue 배열로 반환. 이후 queue를 순회하면서 프로세스의 우선순위가 높지 않다면 다시 배열에 집어 넣고, 우선순위가 높다면 answer을 증가시키고 해당 프로세스가 location 값과 일치하는 확인하는 방법으로 해결했습니다.