You are viewing a single comment's thread. Return to all comments →
Swift solution, revisited
func jumpingOnClouds(c: [Int], k: Int) -> Int { var energy = 100 var position = 0 repeat { position = (position + k) % c.count energy -= 1 + c[position] * 2 } while (position != 0) 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 →
Swift solution, revisited