You are viewing a single comment's thread. Return to all comments →
0 2: The substrings of aab are a, b, aa, ab, and aab, so we print on a new line.
Is this right? Is the substring (0,2) of "aabaa" really "aab".
Shouldn't it be "aa" and not "aa b "
There must be something wrong here...
C++ substr takes in the start pos, and len, but the len doesn't count towards the actual string.
In order to get "aab" you would have to get substring (0, 3).
Seems like cookies are disabled on this browser, please enable them to open this website
How Many Substrings?
You are viewing a single comment's thread. Return to all comments →
There's something wrong!
Is this right? Is the substring (0,2) of "aabaa" really "aab".
Shouldn't it be "aa" and not "aa b "
There must be something wrong here...
C++ substr takes in the start pos, and len, but the len doesn't count towards the actual string.
In order to get "aab" you would have to get substring (0, 3).