public static void findPair(int[][] nums) {
        if (nums.length == 0 || nums[0].length == 0)
            return;
        HashSet<Integer> set = new HashSet<>();
        for (int i = 0; i < nums.length; ++i) {
            for (int j = 0; j < nums[0].length; ++j) {
                int val = nums[i][j];
                if (set.contains(val)) {
                    System.out.println(val);
                    set.remove(val);
                } else {
                    set.add(val);
                }
            }
        }
    }