mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-06 17:50:39 +08:00
Update AllCombinationsOfSizeK.js (#1530)
* Update AllCombinationsOfSizeK.js * Update AllCombinationsOfSizeK.js * Update AllCombinationsOfSizeK.test.js Changes made it the type of testing. Instead of testing the class now the program will test the function * Update AllCombinationsOfSizeK.js * Update AllCombinationsOfSizeK.js * Update AllCombinationsOfSizeK.js * Update AllCombinationsOfSizeK.test.js * Update AllCombinationsOfSizeK.test.js
This commit is contained in:
@ -1,9 +1,9 @@
|
||||
import { Combinations } from '../AllCombinationsOfSizeK'
|
||||
import { generateCombinations } 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([
|
||||
const res = generateCombinations(3, 2)
|
||||
expect(res).toEqual([
|
||||
[1, 2],
|
||||
[1, 3],
|
||||
[2, 3]
|
||||
@ -11,8 +11,8 @@ describe('AllCombinationsOfSizeK', () => {
|
||||
})
|
||||
|
||||
it('should return 6x2 matrix solution for n = 4 and k = 2', () => {
|
||||
const test2 = new Combinations(4, 2)
|
||||
expect(test2.findCombinations()).toEqual([
|
||||
const res = generateCombinations(4, 2)
|
||||
expect(res).toEqual([
|
||||
[1, 2],
|
||||
[1, 3],
|
||||
[1, 4],
|
||||
|
Reference in New Issue
Block a user