You are viewing a single comment's thread. Return to all comments →
//Simple JAVA Solution Map map=new HashMap<>();
for(int num: ar){ map.put(num,map.getOrDefault(num,0)+1); } int sum=0; for(Map.Entry<Integer, Integer> me: map.entrySet()){ if(me.getValue()>1){ sum+=me.getValue()/2; } } return sum; }
}
Seems like cookies are disabled on this browser, please enable them to open this website
Sales by Match
You are viewing a single comment's thread. Return to all comments →
//Simple JAVA Solution Map map=new HashMap<>();
}