--

Why do you think that it returns "bb"?

Check it again. It returns "ba".

It compares (s[1] > s[1 + 1]) that is 'b' > 'a'

and then erase s[1] that is 'b'. Therefure we get "ba" as result.

--

--

Responses (1)