Skip to content

Commit 03db547

Browse files
committed
tests: add more test cases
1 parent 89f3773 commit 03db547

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Dynamic-Programming/tests/LongestIncreasingSubsequence.test.js

+8
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,19 @@ describe('Testing longestIncreasingSubsequence', () => {
44
it.each([
55
[[], 0],
66
[[1], 1],
7+
[[2, 2], 1],
8+
[[3, 3, 3], 1],
9+
[[4, 4, 4, 4], 1],
710
[[1, 2], 2],
811
[[1, 2, 2, 2, 2], 2],
912
[[1, 0, 2], 2],
1013
[[1, 10, 2, 30], 3],
1114
[[5, 8, 3, 7, 9, 1], 3],
15+
[[10, 9, 2, 5, 3, 7, 101, 18], 4],
16+
[[10, 10, 9, 9, 2, 2, 5, 5, 3, 3, 7, 7, 101, 101, 18, 18], 4],
17+
[[0, 1, 0, 3, 2, 3], 4],
18+
[[1, 1, 2, 2, 2], 2],
19+
[[1, 1, 2, 2, 2, 3, 3, 3, 3], 3],
1220
[[0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15], 6]
1321
])('check with %j', (input, expected) => {
1422
expect(longestIncreasingSubsequence(input)).toBe(expected)

0 commit comments

Comments
 (0)