First solution to palindrome numbers problem