Skip to content

Commit b5d77fa

Browse files
committed
feat(permutations): clarify in README that the input integers will not repeat
1 parent c89cb99 commit b5d77fa

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

16_permutations/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
# Exercise 16 - permutations
22

33
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
4+
5+
The integers will not repeat.
6+
47
```javascript
5-
permutations([1,2,3]); // [[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]]
8+
permutations([1, 2, 3]); // [[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]]
69
// An empty set has a single permutation, 0! = 1
710
permutations([]); // [[]]
811
```

0 commit comments

Comments
 (0)