#3129

Find All Possible Stable Binary Arrays I

expert · 1160 · lc medium +32 · 27.2% accepted · 135 likes · top 5%

Description

Given positive integers zero, one, and limit, a binary array is stable if it contains exactly zero zeros and one ones, and every subarray of length greater than limit contains at least one 0 and one 1. Return the count of stable binary arrays modulo 109 + 7.

Code

1
2
3