problem
solution
利用測資作弊
1 | class Solution { |
option 1 - recursive
1 | class Solution { |
option 2 - dp
1 | class Solution { |
analysis
- time complexity
O(1)
, beacuse ofn<=8
- space complexity
O(1)
利用測資作弊
1 | class Solution { |
1 | class Solution { |
1 | class Solution { |
O(1)
, beacuse of n<=8
O(1)