Search
⌘K

Leetcode 3343. Count Number of Balanced Permutations

Count the distinct permutations of a digit string (length ≤ 80, digits 0–9 with repeats) whose sum of digits at even indices equals the sum at odd indices. Because of duplicates and large n, this requires a combinatorial/DP approach that assigns digit counts to even/odd positions and returns the count modulo 1e9+7.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.