Leetcode 3339. Find the Number of K-Even Arrays
Count how many length-n arrays with elements in [1..m] have exactly k prefixes whose prefix sum is even (i.e., the prefix sum parity is even at exactly k positions), returning the answer modulo 10^9+7. The core challenge is modeling parity transitions and using combinatorics/DP to count possibilities efficiently for large n and m.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
0
Hello Interview Premium
Your account is free and you can post anonymously if you choose.