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