Count Number of Balanced Permutations
Choose which digits sit at even positions with a DP over count and sum, weighting each choice by inverse factorials.
Choose which digits sit at even positions with a DP over count and sum, weighting each choice by inverse factorials.