← ALL NOTES
Math

3343. Count Number of Balanced Permutations

Given a digit string num. A permutation of its digits is balanced if the sum of digits at even positions equals the sum at odd positions. Count the distinct balanced permutations modulo 1e9+7.

Loading…