14. Write a JavaScript function to get all possible subset with a fixed length (for example 2) combinations in an array. Sampl | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

14. Write a JavaScript function to get all possible subset with a fixed length (for example 2) combinations in an array. Sampl

14. Write a JavaScript function to get all possible subset with a fixed length (for example 2) combinations in an array. Sample array : [1, 2, 3] and subset length is 2 Expected output : [[2, 1], [3, 1], [3, 2], [3, 2, 1]] . . هذا اشلون ينحل فدوة لي يعرف يحلها ...

8th Dec 2016, 9:39 PM
Nashwan Aziz
Nashwan Aziz - avatar
1 Answer
0
14. Write a JavaScript function to get all possible subset with a fixed length (for example 2) combinations in an array. Sample array : [1, 2, 3] and subset length is 2 Expected output : [[2, 1], [3, 1], [3, 2], [3, 2, 1]] . .
8th Dec 2016, 9:40 PM
Nashwan Aziz
Nashwan Aziz - avatar