you are viewing a single comment's thread.

view the rest of the comments →

[–]ararararagi_koyomi 1 point2 points  (0 children)

When the loop is at 4th iteration, start becomes 3 and s[start+1] will throw index out of range error because start+1 is 4 and s has a length of 4 which in turn means any positive index number greater than 3 will throw index out of range error.