write a java script function to get all possible subset with a fixed length ( for example 2 ) combination in an array. sample ar | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

write a java script function to get all possible subset with a fixed length ( for example 2 ) combination in an array. sample ar

write a java script function to get all possible subset with a fixed length ( for example 2 ) combination in an array. sample array :( 1 , 2 , 3) and subset length is 2 expected out put :((2,1), (3,1), (3,2), (3,2,1))

15th Dec 2016, 9:00 PM
Nashwan Aziz
Nashwan Aziz - avatar
1 Answer
0
Hi, I haven't done it in Java but you could check my phyton program called permutations. You could use the same logic
7th Mar 2017, 7:12 AM
Qwerty