Count Unordered Ways to Reach a Total Weight

Given two integers total and k, form a total weight of total using items with weights 1, 2, ..., k. Each weight may be used any number of times.

Return the number of distinct combinations mod...

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: