Tap here to switch tabs
Problem
Submissions

Problem: Find All Possible Stable Binary Arrays I

med
30 min
Try to solve the Find All Possible Stable Binary Arrays I problem.

Statement

You are given 33 positive integers zero, one, and limit.

A binary array arr is considered stable if:

  • The count of 00s in arr is exactly zero.

  • The count of 11s in arr is exactly one.

  • Every subarray of arr with a size strictly greater than limit contains both 00 and 11.

Return the total number of stable binary arrays. Since the answer may be very large, return it modulo 109+710^9 + 7.

Constraints:

  • 1≤1 \leq zero, one, limit ≤200\leq 200

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Find All Possible Stable Binary Arrays I

med
30 min
Try to solve the Find All Possible Stable Binary Arrays I problem.

Statement

You are given 33 positive integers zero, one, and limit.

A binary array arr is considered stable if:

  • The count of 00s in arr is exactly zero.

  • The count of 11s in arr is exactly one.

  • Every subarray of arr with a size strictly greater than limit contains both 00 and 11.

Return the total number of stable binary arrays. Since the answer may be very large, return it modulo 109+710^9 + 7.

Constraints:

  • 1≤1 \leq zero, one, limit ≤200\leq 200