Map : 키, value 값 쌍으로 이뤄진 데이터.
HashMap
HashMap<Integer,Integer> map1 = new HashMap<Integer,Integer>();
for(int i =0; i<n; i++){
if(map1.get(arr[i]) == null){
map1.put(arr[i], 1);
}else{
map1.put(arr[i],map1.get(arr[i])+1);
}
}
TreeMap