mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-12-19 06:58:15 +08:00
chore: Merge pull request #748 from chiranjeev-thapliyal/master
added Backtracking/AllCombinationsOfSizeK
This commit is contained in:
13
Backtracking/tests/AllCombinationsOfSizeK.test.mjs
Normal file
13
Backtracking/tests/AllCombinationsOfSizeK.test.mjs
Normal file
@@ -0,0 +1,13 @@
|
||||
import { Combinations } from '../AllCombinationsOfSizeK'
|
||||
|
||||
describe('AllCombinationsOfSizeK', () => {
|
||||
it('should return 3x2 matrix solution for n = 3 and k = 2', () => {
|
||||
const test1 = new Combinations(3, 2)
|
||||
expect(test1.findCombinations).toEqual([[1, 2], [1, 3], [2, 3]])
|
||||
})
|
||||
|
||||
it('should return 6x2 matrix solution for n = 3 and k = 2', () => {
|
||||
const test2 = new Combinations(4, 2)
|
||||
expect(test2.findCombinations).toEqual([[1, 2], [1, 3], [1, 4], [2, 3], [2, 4], [3, 4]])
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user