Solution for Problem 9 - recursive semordnilap