mirror of https://github.com/01-edu/public.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
372 B
14 lines
372 B
4 years ago
|
## Sums
|
||
|
|
||
|
### Instructions
|
||
|
|
||
|
Create a function called `sums` that receives a number and returns its
|
||
|
partitions.
|
||
|
A partition of a number is a group of numbers that its sum is equal to that
|
||
|
number.
|
||
|
Sums must ignore duplicates ([1,2] and [2,1] are duplicates).
|
||
![]()
4 years ago
|
Sums must return sorted array of sorted partitions.
|
||
4 years ago
|
|
||
|
Example:
|
||
![]()
4 years ago
|
sums(4) = [ [1, 1, 1, 1], [1, 1, 2], [1, 3], [2, 2] ]
|