Function to check if the string is palindrome
bool checkPalindrome ( string s ) { for ( int i = 0 ; i < s . length ( ) ; i ++ ) { if ( s [ i ] != s [ s . length ( ) - i - 1 ] ) return false ; } return true ; }