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.
Don't need integration, minima, or any such. Don't even need a queue or container, really.
Either the problem is solvable or it's not -- but the problem statement doesn't leave room for unsolvable.
Thus assuming it's solvable, and you're looking for the lowest index from which it works, vinay_star_lord's solution (which I came up with on my own) works without a container, i.e., constant space.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Truck Tour
You are viewing a single comment's thread. Return to all comments →
Don't need integration, minima, or any such. Don't even need a queue or container, really.
Either the problem is solvable or it's not -- but the problem statement doesn't leave room for unsolvable.
Thus assuming it's solvable, and you're looking for the lowest index from which it works, vinay_star_lord's solution (which I came up with on my own) works without a container, i.e., constant space.