If we have found a char equal to current char and does not exist side to it , return false
if ( st . contains ( str [ i ] ) & ( str [ i ] != st . last ( ) ) ) { return false ; } st . add ( str [ i ] ) ; } return true ; }