Skip to content

[프로그래머스+LeetCode 75] [Lucy] 25년 14주차 3문제 풀이 #118

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
merged 5 commits into from
Apr 10, 2025

Conversation

hyer0705
Copy link
Owner

@hyer0705 hyer0705 commented Apr 3, 2025

간단한 문제 회고

  • Graph를 DFS로 순회하는 법에 대해서 다시 익힐 수 있었다.
  • union find algorithm이 생각나서 해당 알고리즘을 학습하고 풀이했다. 단, 각 city의 parent들이 업데이트가 되어 있지 않은 경우가 있으므로 마지막에 한 번더 각각의 city가 find() 연산을 수행하여 parent를 업데이트 해줘야 한다.
  • Number of Provinces 문제는 dfs로도 풀이할 수 있어서 다른 사람들의 풀이를 보고 dfs로 풀이하는 법도 공부했다.
  • backtracking을 활용하여 완전탐색을 풀이했다. backtracking 알고리즘을 게임 룰에 맞게 어떤 식으로 풀이해야 하는지 로직을 생각해내기 어려웠다. 결국 문제 해설과 chat gpt를 사용하여 한단계씩 내가 코드를 어떻게 작성해 나가야 하는지 물어보며 풀이했다.

hyer0705 added 4 commits April 3, 2025 15:53
- Chat GPT에게 하나씩 물어보면서 풀이해봤습니다. 이동할 수 있는지 판단하는 함수는 구현하는게 쉬웠지만...완전탐색 로직이 들어가는 게임 play 함수는 구현하기 어려웠습니다.
@hyer0705 hyer0705 changed the title 2025 3 w04[프로그래머스+LeetCode 75] [Lucy] 25년 14주차 3문제 풀이 [프로그래머스+LeetCode 75] [Lucy] 25년 14주차 3문제 풀이 Apr 8, 2025
- 841. Keys and Rooms 문제 회고 작성
- 547. Number of Provinces 문제 회고 작성
- 사라지는 발판 문제 회고 작성
@hyer0705 hyer0705 merged commit 4d3b4e7 into main Apr 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant