Get All Substrings Of A String In Python
No built-in function only algorithm
1 min readNov 12, 2023
Let’s say you want to find all possible substrings of a BANANA
in Python. Hopefully, there is no built-in function for this, and we have to use our brains to develop an algorithm for it.
One way to achieve this is by setting two pointers, i
at the beginning and j
at the end of the string. We start off by…