Frog river stone crossing
Your task
A frog crosses a river by jumping on stones at the given strictly-increasing positions (the first stone is at 0). Its first jump must be exactly 1 unit. After a jump of k units the next jump must be k-1, k, or k+1 units (and must be positive), landing exactly on a stone. Return whether the frog can reach the last stone. The list has at least one stone.
Examples
frog_jump(stones: list[int]) -> boolExample 1
Input
frog_jump([0, 1, 3, 5, 6, 8, 12, 17])Output
True