I was solving the problem to find all possible substrings of a string using recursion but I was getting segmentation fault.