java - how do i compare each character of a same string using a for loop? -


so have make program have compare each character of string see if occur in string more once or not, if occur more once have delete string array list instance "peer" , "pear" should remove "peer" because there 2 e's in "peer", how go doing this?

here hint. check whether there duplicate character can use set.

for each character of string     check if char in set     if yes          can delete string arraylist , stop checking string     else          add char set 

Comments

Popular posts from this blog

'hasOwnProperty' in javascript -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -

How to understand 2 main() functions after using uftrace to profile the C++ program? -