Function to check if the string is palindrome
bool isPalindrome ( string & s , int i , int j ) { int p = j ; for ( int k = i ; k <= p ; k ++ ) { if ( s [ k ] != s [ p ] ) return false ; p -- ; } return true ; } int countWays ( string & s ) {