https://leetcode-cn.com/problems/single-number/
class Solution {
public int singleNumber(int[] nums) {
Map<Integer,Integer> map=new HashMap<>();
for (int num : nums) {
if (map.containsKey(num)){
map.put(num, num + 1);
}else {
map.put(num,1);
}
}
int key=0;
for (Map.Entry<Integer, Integer> m :map.entrySet()){
if (m.getValue().equals(1)) {
key= m.getKey();
}
}
return key;
}
}