Skip to content

Latest commit

 

History

History

sum-of-numbers

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

(This is my first program...)

Given a number A and a number B (both should be positive), find the number of ways that B numbers can be summed to A (Order MATTERS).

p.s. (You are going to need to change the FindWays in the description to Find_ways)

E.x. find_ways(5,3) => 21

The top example would be because (Order Matters):

0+0+5 = 5

0+1+4 = 5

0+2+3 = 5

0+3+2 = 5

0+4+1 = 5

0+5+0 = 5

1+0+4 = 5

1+1+3 = 5

1+2+2 = 5

1+3+1 = 5

....

or find_ways(19,6)=> 42504

(P.s. There may or may not be an equation... You don't have to find all of them)