There is a
You are given an integer array obstacles of length obstacles[i] indicates that there is an obstacle on lane obstacles[i] at point i. If obstacles[i] is i. There is at most one obstacle among the
When the frog is on lane lane at point i:
The frog can move straight ahead to point lane if there is no obstacle on lane lane at point
The frog can make a side jump to any other lane at the same point i if the chosen target lane does not have an obstacle at point i.
Return the minimum number of side jumps required for the frog to reach point
Note: The frog cannot jump to a lane that contains an obstacle at the current point, but it can jump across an obstructed lane.
Constraints:
obstacles.length
obstacles[i]
obstacles[0] obstacles[n]
There is a
You are given an integer array obstacles of length obstacles[i] indicates that there is an obstacle on lane obstacles[i] at point i. If obstacles[i] is i. There is at most one obstacle among the
When the frog is on lane lane at point i:
The frog can move straight ahead to point lane if there is no obstacle on lane lane at point
The frog can make a side jump to any other lane at the same point i if the chosen target lane does not have an obstacle at point i.
Return the minimum number of side jumps required for the frog to reach point
Note: The frog cannot jump to a lane that contains an obstacle at the current point, but it can jump across an obstructed lane.
Constraints:
obstacles.length
obstacles[i]
obstacles[0] obstacles[n]