mirror of
https://github.moeyy.xyz/https://github.com/trekhleb/javascript-algorithms.git
synced 2024-12-25 22:46:20 +08:00
Add more tests.
This commit is contained in:
parent
d5a8b1e8d5
commit
9de6bc7de3
@ -6,6 +6,9 @@ describe('integerPartition', () => {
|
|||||||
expect(integerPartition(2)).toBe(2);
|
expect(integerPartition(2)).toBe(2);
|
||||||
expect(integerPartition(3)).toBe(3);
|
expect(integerPartition(3)).toBe(3);
|
||||||
expect(integerPartition(4)).toBe(5);
|
expect(integerPartition(4)).toBe(5);
|
||||||
|
expect(integerPartition(5)).toBe(7);
|
||||||
|
expect(integerPartition(6)).toBe(11);
|
||||||
|
expect(integerPartition(7)).toBe(15);
|
||||||
expect(integerPartition(8)).toBe(22);
|
expect(integerPartition(8)).toBe(22);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
/**
|
/**
|
||||||
* @param {Number} number
|
* @param {number} number
|
||||||
|
* @return {number}
|
||||||
*/
|
*/
|
||||||
export default function integerPartition(number) {
|
export default function integerPartition(number) {
|
||||||
// Create partition matrix for solving this task using Dynamic Programming.
|
// Create partition matrix for solving this task using Dynamic Programming.
|
||||||
|
Loading…
Reference in New Issue
Block a user