Commit 2b3b0cb9 authored by sachin.shukla's avatar sachin.shukla

Initial Commit

parent e29dd2bd
For a given total (T), and a weight (w) find the number of combinations where total T can be achieved by summing up
all the weights range from 1 to w.
<b> e.g. if T=5 and w=3 then, </b>
- total 5 can be achieved by summing up all 1s and that is one way e.g. 1,1,1,1,1.
- and then going with the higher weights till w=3 and below is the result where it can be achieved in 5 ways.
The program should output value 5 as shown below.
`1,1,1,1,1`
`1,1,1,2`
`1,2,2`
`1,1,3`
`2,3`
write your code under <b> exam.CountCombinations#getNumberOfWays() </b> method
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment