If both are equal then the substring is a palindrome
if ( hash_LR == reverse_hash_LR ) { if ( isPalindrome ( str , L , R ) == true ) { System . out . printf ( " The ▁ Substring ▁ [ % d ▁ % d ] ▁ is ▁ a ▁ " + "palindromeNEW_LINE", L, R); } else { System . out . printf ( " The ▁ Substring ▁ [ % d ▁ % d ] ▁ is ▁ not ▁ a ▁ " + "palindromeNEW_LINE", L, R); } } else { System . out . printf ( " The ▁ Substring ▁ [ % d ▁ % d ] ▁ is ▁ not ▁ a ▁ " + "palindromeNEW_LINE", L, R); } } return ; }