Check if an input string by user is a palindrome

O(N), check each element once