Solve next palindrome problem in ruby.