Test case


  • 0
    M

    11
    11
    [1,2,3]
    [11,12,13]

    why the answer is 17? Shouldn't that be 12. Because initial w is 11 and can only pick the project indexed 0, thus the answer is 12


  • 0
    C

    You first do the first project and increase your capital to 12. Now you have enough capital to do second project. When you do that You increase your capital to 14 and now you have enough capital to do last project and you can increase your capital to 17. It is similar to example.


Log in to reply
 

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