0

Help plz 💔 I need java code "remove the duplicate elements in array" using only for /if/while đŸ˜«

x=[1,2,2,2,3,5,3] ==== x=[1,2,3,5]

31st Oct 2017, 4:59 PM
tuqa mohammad
tuqa mohammad - avatar
2 Answers
+ 3
Just use a set and it will automatically remove duplicates. example: Set<T> mySet = new HashSet<T>(Arrays.asList(someArray));
31st Oct 2017, 5:26 PM
Witty Phantom
Witty Phantom - avatar
0
with out set 💔😭 only for loop and if statement
31st Oct 2017, 5:58 PM
tuqa mohammad
tuqa mohammad - avatar