Checking if curr subString is palindrome or not .
int l = 0 , r = curr . length ( ) - 1 ; boolean is_palindrome = true ; while ( l < r ) { if ( curr . charAt ( l ) != curr . charAt ( r ) ) { is_palindrome = false ; break ; } l ++ ; r -- ; }