If the top element is not equal to the current element and it only differs in the case
if ( c != str . charAt ( i ) && Character . toUpperCase ( c ) == Character . toUpperCase ( ( str . charAt ( i ) ) ) ) {