Digit Sum Count

Given two integers a and b, output the count of numbers less than or equal to a whose digit sum equals b. For example, if a=20 and b=5, the numbers 5 and 14 satisfy the condition, so the output is 2.

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: