#3130
Find All Possible Stable Binary Arrays II
international master · 2035 · lc hard +32 · 28.2% accepted · 72 likes · top 6%
Description
Given positive integers zero, one, and limit, count the binary arrays that contain exactly zero zeros and one ones, and in which every subarray longer than limit contains both a 0 and a 1. Return the answer modulo 109 + 7.
Code
1
2
3