E
Ed Redman
I am struggling with the following.
Given a sting of a given length example string = 'bkerhcno'
give all the subsets of string of length 4
I don't need all the permutations just the subsets.
I can use the slice method to give me some subsets i.e
s1 = string.slice(0,4)
s2 = string.slice(1,4) etc.
Just how do I generate all the possible combination of 4 characters.
By analagy, would like to extend to finding all combination of length 5,6,
and 7.
Hope someone can help.
Given a sting of a given length example string = 'bkerhcno'
give all the subsets of string of length 4
I don't need all the permutations just the subsets.
I can use the slice method to give me some subsets i.e
s1 = string.slice(0,4)
s2 = string.slice(1,4) etc.
Just how do I generate all the possible combination of 4 characters.
By analagy, would like to extend to finding all combination of length 5,6,
and 7.
Hope someone can help.