Tap here to switch tabs
Problem
Submissions

Problem: Find All Possible Stable Binary Arrays I

Find All Possible Stable Binary Arrays I asks you to count binary arrays with exact zero and one counts, requiring subarrays longer than the limit to contain both values. Return total modulo a prime.

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

Find All Possible Stable Binary Arrays I asks you to count binary arrays with exact zero and one counts, requiring subarrays longer than the limit to contain both values. Return total modulo a prime.

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