I'm trying to turn a given string ("hello") to a list containing every list of substrings. for example:
[["hello"],["h,"ello"],["he","llo"],["hel","lo"],["hell","o"],\
["h","e","llo"],["h","e","l","lo"],["h","e","l","l","o],["he","l,"lo"],\
["hel","l,"o"],["hell","o]....etc....].
I understand the fastest way should be a recursion function, but i just can't get it right. something similar to:
x = "hello"
wordset=[]
string_div(0,x,wordset)
...
...
def string_div(i,word,wordset)
wordset.append(wordset+[word[i:])
......