Count non-decreasing arrays with given digit sums

0
Remix

You get an array requiredSum of length n. Count arrays result of length n that are non-decreasing and where the digit sum of result[i] equals requiredSum[i] for every i, within the value bound the problem gives; return the count modulo a large prime. Explain the dynamic programming over positions and values and how prefix sums keep it fast.

MicrosoftOnline assessmentLast asked Aug 2026
No answer yet. Write the first one; the best answer gets endorsed.