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.
defjumpingOnClouds(c):idx=0jumps=0whileidx!=len(c)-1:# Greedy, if can jump 2, then do itidx=idx+2ifidx+2<len(c)andc[idx+2]==0elseidx+1jumps+=1returnjumps
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Jumping on the Clouds
You are viewing a single comment's thread. Return to all comments →