import java.util.*;


public class Solution {
    /**
     * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可
     *
     * 
     * @param arr int一维数组 
     * @param k int 
     * @return int
     */
    public int foundOnceNumber(int[] arr, int k) {
        // write code here
        HashMap<Integer, Integer> hashMap = new HashMap<>();
        for (int i = 0; i < arr.length; i++) {
            int num = hashMap.getOrDefault(arr[i], 0);
            num++;
            hashMap.put(arr[i], num);
        }
        int res = 0;
        for (int i = 0; i < arr.length; i++) {
            int num = hashMap.get(arr[i]);
            if (num == 1) {
                res = arr[i];
                break;
            }
        }
        return res;
    }
}