You are viewing a single comment's thread. Return to all comments →
def jumpingOnClouds(c):
jump = 0 i = 0 while True: if (i+2)<= (len(c)-1) and c[i+2] == 0 : jump = jump + 1 i = i + 2 elif (i+1)<= len(c)-1: i = i + 1 jump = jump + 1 else: break return jump
Seems like cookies are disabled on this browser, please enable them to open this website
An unexpected error occurred. Please try reloading the page. If problem persists, please contact support@hackerrank.com
Jumping on the Clouds
You are viewing a single comment's thread. Return to all comments →
Python 3
def jumpingOnClouds(c):