Skip to content

Conversation

@BangDori
Copy link
Member

@BangDori BangDori commented Jan 14, 2025

문제

Type Info
Time Complexity O(N)
Space Complexity O(1)
Algorithm Greedy
Data Structure X

Constraints

  • 1 <= nums.length <= 10^4
  • 0 <= nums[i] <= 10^5

Edge Case

  • 없음

풀이

케이스 바이 케이스별로 생각할 경우 경우의 수가 무수히 많기 때문에 일반적인 방식으로 해당 문제를 해결할 수 없다고 생각하였고 O(N)으로 풀이할 수 있는 다른 방법에 대해서 고민함.

nums[index]가 3이라면 현재 위치(index)에서 1, 2, 3만큼 점프가 가능한 것이므로, 이동할 수 있는 최대 위치만을 생각하여 문제에 접근

어려웠던 점

  • 없음

알게된 점

  • 그리디는 아이디어가 99%다.

@github-actions github-actions bot merged commit 17c8dbc into main Jan 22, 2025
2 checks passed
@BangDori BangDori deleted the bangdori/jump-game branch January 22, 2025 04:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants