views:

14

answers:

0

I have a straing ab and there is counter array which contains number of times repeated for each charater. Say repeated[a]=2 and repeated[b]=2. Then the possible strings to be generated are ab,aab,aabb,abb. I am looking for solution which will work for moderarelty high input size. Any algorthims for this would be highly helpfull. Thanks