# breaking it down easy

Jump the Stones

The river crossing: stones at fixed spots, and your longest jump is k. One gap too wide and — splash! 🐸

You start on the bank at position 0. You get the stone positions (increasing; the last stone is the far bank). Print across if every jump (bank to first stone, then stone to stone) is at most k, otherwise splash.

Example:

Input: positions = [2, 4, 7, 9], k = 3 Output: across

The gaps are 2 (bank→2), 2 (2→4), 3 (4→7), 2 (7→9) — every gap is at most 3, so the crossing succeeds.

💡 need a hint?

brk-jump-stones.py🔒 given lines are locked — write your code in between
loading...