Palindrome Counter Hackerrank Solution