Function that returns true if s [ i ... j ] + s [ k ... l ] + s [ p ... q ] is a palindrome
static bool isPalin ( int i , int j , int k , int l , int p , int q , String s ) { int start = i , end = q ; while ( start < end ) { if ( s [ start ] != s [ end ] ) { return false ; } start ++ ; if ( start == j + 1 ) { start = k ; } end -- ; if ( end == p - 1 ) { end = l ; } } return true ; }