Remove duplicates from integer array

前端 未结 23 2414
执念已碎
执念已碎 2020-12-01 18:52

I having a problem with coding this:

Write a static method named removeDuplicates that takes as input an array of integers and returns as a result a new

23条回答
  •  难免孤独
    2020-12-01 19:18

    To Preserve the ordering and to remove duplicates in the integer array, you can try this:

    public void removeDupInIntArray(int[] ints){
        Set setString = new LinkedHashSet();
        for(int i=0;i

    Hope this helps.

提交回复
热议问题