Use of st variable

What is the use of st variable passed to the solve function as a parameter? Why are we doing the reverse of strings a & b? Is it to make the length of both a and b string equal?