Tuesday, March 5, 2013

Generate Possible Sub-strings


Problem:

Generate all the possible substrings using the characters of a given string. Write code. (The order of chars do not matter, i.e., ac <=> ca) 
i/p: abc 
o/p: { a,b,c,ab,ac,bc,abc} 


Solution (backtracking):
https://gist.github.com/leehomyc/5335144

No comments:

Post a Comment