← Questions

Count non-decreasing arrays with given digit sums

0
MicrosoftCodingLast asked Aug 2026

A coding interview question asked in Microsoft's HackerRank assessment, last asked Aug 2026. It tests dynamic programming, digits and counting.

You are given an array required_sum of length n. Count the arrays result of length n such that result is non-decreasing, every value is between 1 and 5000, and the sum of the decimal digits of result[i] equals required_sum[i] at every…

Sign in to unlock this question

The full prompt, the worked answer and your own canvas or code with the AI tutor. New accounts get 5 credits: each one unlocks a question for good.

Where it's asked

What it tests

dynamic programming · digits · counting

Your code and the AI tutor open when you unlock this question.