Skip to content

Commit f8d9ee9

Browse files
committed
feat(permutations): add example to README for an empty array
1 parent ef5b1cd commit f8d9ee9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

16_permutations/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Exercise 16 - permutations
22

3-
Write a function that takes in an input array of an consecutive positive integers, starting at 1, and returns an array of all possible permutations of the original array
4-
3+
Write a function that takes in an empty array or an input array of an consecutive positive integers, starting at 1, and returns an array of all possible permutations of the original array
54
```javascript
65
permutations([1,2,3]); // [[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]]
6+
// An empty set has a single permutation, 0! = 1
7+
permutations([]); // [[]]
78
```

0 commit comments

Comments
 (0)