[NeetCode/Python] Climbing Stairs
·
Algorithm/NeetCode
문제 링크: https://neetcode.io/problems/climbing-stairs NeetCode neetcode.io 단순한 조합 문제라고 생각했다. 이런 비슷한 문제를 예전에 풀었지만 나중에야 기억이 났는데.. 암튼 초반에 그래서 삽질을 좀 했다. [초반 틀린 풀이]from itertools import permutationsclass Solution: def climbStairs(self, n: int) -> int: # 조합 구하기 + 순서 고려 result = 1 # consist of all 1s + possible 2s for i in range(1, n//2 + 1): # i = num of 2 goal..