All of you are posting DP solution which is O(N). What does a brute force solution for this problem look like?
Is the brute force solution to start at cost & cost and jump one or two steps and find the min cost? Which is also O(N) right?
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.