Skip to content

Commit ca2eee9

Browse files
nik-revmao-sz
andauthored
feat: omit .sort() for permutations of length 0 and 1
Co-authored-by: MaoShizhong <[email protected]>
1 parent fc19279 commit ca2eee9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

16_permutations/permutations.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ const permutations = require("./permutations");
22

33
describe("permutations", () => {
44
test("1 possible permutation for a set containing 0 numbers", () => {
5-
expect(permutations([]).sort()).toEqual([[]].sort());
5+
expect(permutations([])).toEqual([[]]);
66
});
77

88
test.skip("1 possible permutation for a set containing 1 number", () => {
9-
expect(permutations([1]).sort()).toEqual([[1]].sort());
9+
expect(permutations([1])).toEqual([[1]]);
1010
});
1111

1212
test.skip("2 possible permutations for a set containing 2 numbers", () => {

0 commit comments

Comments
 (0)