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.
Jumping on the Clouds
Jumping on the Clouds
Sort by
recency
|
3282 Discussions
|
Please Login in order to post a comment
Solution i have tried::: Java
We already know this input has a solution, therefore there can't be any consecutive '1's in the input. Worst case, a '1' 2 cells ahead forces us to short-jump but then we're guaranteed a long-jump. We can use this to solve the problem faster:
Here is problem solution in Python, Java, C++, C and Javascript - https://programmingoneonone.com/hackerrank-jumping-on-the-clouds-problem-solution.html