We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
I tried doing this, but while its easy given that you always reach at least the one step before hitting minimum before running out of money, I wan't sure how to handle cases where you didn't reach that cut off. I'm curious a full O(n)=1 solution and try to understand it.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Halloween Sale
You are viewing a single comment's thread. Return to all comments →
I tried doing this, but while its easy given that you always reach at least the one step before hitting minimum before running out of money, I wan't sure how to handle cases where you didn't reach that cut off. I'm curious a full O(n)=1 solution and try to understand it.