Partition of an Integer + Number of partitions

后端 未结 4 787
说谎
说谎 2020-12-18 12:08

A partition of an integer n is a way of writing n as a sum of positive integers. For

example, for n=7, a partition is 1+1+5. I need a program that finds all the

4条回答
  •  星月不相逢
    2020-12-18 12:44

    A sort of "hack" would be to make r an argument of part, pass it along recursively an just print the output if level equals r.

提交回复
热议问题