What is a brute force solution for this problem?


  • 0
    C

    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[0] & cost[1] and jump one or two steps and find the min cost? Which is also O(N) right?


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.