Update palindrome.cpp

O(n) maybe