Skip to content

Practice Jump Game VII

Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.

Medium#1871
LeetCode Problem

Jump Game VII

Problem Statement

Start at index 0 of binary string s, which contains 0 at that position. A jump from i must move forward between minJump and maxJump positions inclusive, remain within s, and land on a 0. Return whether the final index is reachable.

Source: Jump Game VII on LeetCode. Use the original task for its coding environment and submissions.

Examples

# Example 1

Input
s = "011010", minJump = 2, maxJump = 3
Output
true

# Example 2

Input
s = "01101110", minJump = 2, maxJump = 3
Output
false

Constraints

2 <= s.length <= 10^5
s[i] is either '0' or '1'.
s[0] == '0'
1 <= minJump <= maxJump < s.length

Related LeetCode Problems

Practice more problems similar to Jump Game VII.

Review your practice with PhantomCodeAI

After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.