Opening your workspace…
Workspace/Coding room
Opening your workspace…
Train with Omni-Man by playing catch above the clouds. Dad throws a baseball east, all the way around Earth. You want to catch it on its first lap. At second 0, you and the ball are at marker 0. Each second, the ball flies east by the next distance in throws. In that same second, you can fly up to speed markers east or west, or hover. Return the earliest positive second when you can end up at the same marker as the ball, or -1 if you miss it.
20, [5,1,4], 3Output2Fly east 3 markers each second. The ball is out of reach at marker 5 after one second, but you both reach marker 6 after two.
24, [7,7,7], 2Output3Fly west one marker each second to meet the ball at marker 21. Its first two positions, 7 and 14, are respectively 7 and 10 markers from the start by the shorter route, beyond your reach at those times.
Measure the shorter distance around the ring to the ball after each throw.
function solve(circumference, throws, speed) { // Write your solution here. }
Tab inserts two spaces. Shift+Tab outdents. Use the arrow keys and Tab to choose a suggestion. Press Escape, then Tab, to leave the editor. Press Control or Command with apostrophe to run samples or with Enter to submit.