You are viewing a single comment's thread. Return to all comments →
Python 3:
def jumpingOnClouds(c, k): n = len(c) i = k % n jump_list = [c[0]] while (i != 0): jump_list.append(c[i]) i = (i + k) % n energy = 100 for i in jump_list: energy -= 1 if i == 1: energy -= 2 return energy
Seems like cookies are disabled on this browser, please enable them to open this website
Jumping on the Clouds: Revisited
You are viewing a single comment's thread. Return to all comments →
Python 3: