Tap here to switch tabs
Problem
Submissions

Problem: Generate Binary Strings Without Adjacent Zeros

Generate Binary Strings Without Adjacent Zeros asks you to return every binary string of a given length where no two zeros appear consecutively. Strings may be in any order.

Statement

Given a positive integer n, return all binary strings of length n such that no two adjacent characters are equal to ′0′'0'.

The resulting strings may be returned in any order.

Constraints:

  • 1≤1 \leq n ≤18\leq 18

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Generate Binary Strings Without Adjacent Zeros

Generate Binary Strings Without Adjacent Zeros asks you to return every binary string of a given length where no two zeros appear consecutively. Strings may be in any order.

Statement

Given a positive integer n, return all binary strings of length n such that no two adjacent characters are equal to ′0′'0'.

The resulting strings may be returned in any order.

Constraints:

  • 1≤1 \leq n ≤18\leq 18