given a long string, for example: str = 'abbabaab'
and a short substring: sub = 'ab'
.
I want to get a list of all the indexes where the substring can be found, without iterating over the string.
the expected result would be: res = [0, 3, 6]
given a long string, for example: str = 'abbabaab'
and a short substring: sub = 'ab'
.
I want to get a list of all the indexes where the substring can be found, without iterating over the string.
the expected result would be: res = [0, 3, 6]