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
Post a Comment