I have to form several sub-strings from a single string.
Usual nested for loops with i and j is giving correct result but having time out issue for larger string values(>3K length).
Looking for comprehension or any other solution that might give quick results.
for i in range((len(string)+1)):
for j in range(i+1, (len(string)+1)):
substring_list.append(string[i:j])