Math
3405. Count the Number of Arrays with K Matching Adjacent Elements
Count the arrays of length n with values in [1, m] that have exactly k positions i (1≤i<n) where arr[i]==arr[i−1] (matching adjacent pairs), modulo 1e9+7.
Loading…
Count the arrays of length n with values in [1, m] that have exactly k positions i (1≤i<n) where arr[i]==arr[i−1] (matching adjacent pairs), modulo 1e9+7.
Loading…