Function that returns true if the sub - string starting from index i and ending at index j is a palindrome
bool isPalindrome ( string s , int i , int j ) { while ( i < j ) { if ( s [ i ] != s [ j ] ) return false ; i ++ ; j -- ; } return true ; }