Solution explanation is required!


#1

I am unable to understand the solution. Can someone help?


#2

Check this page: Swap characters in a string