Skip to content

Commit 9de6bc7

Browse files
committedJun 8, 2018
Add more tests.
1 parent d5a8b1e commit 9de6bc7

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed
 

‎src/algorithms/math/integer-partition/__test__/integerPartition.test.js

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ describe('integerPartition', () => {
66
expect(integerPartition(2)).toBe(2);
77
expect(integerPartition(3)).toBe(3);
88
expect(integerPartition(4)).toBe(5);
9+
expect(integerPartition(5)).toBe(7);
10+
expect(integerPartition(6)).toBe(11);
11+
expect(integerPartition(7)).toBe(15);
912
expect(integerPartition(8)).toBe(22);
1013
});
1114
});

‎src/algorithms/math/integer-partition/integerPartition.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/**
2-
* @param {Number} number
2+
* @param {number} number
3+
* @return {number}
34
*/
45
export default function integerPartition(number) {
56
// Create partition matrix for solving this task using Dynamic Programming.

0 commit comments

Comments
 (0)
Please sign in to comment.