Strings

Hi....i am given a number K and a string. I have to create K strings from the string i have.To create a string it must not start with the same letter as the previous one.
Example: 2
aaacas
output: aaa
cas
I have a problem with how am i going to save the new strings because i don't know how many i have to create.
 
Topic archived. No new replies allowed.