circular palindromes hackerrank solution in python