public ArrayList<ArrayList<Integer>> permuteUnique(int[] num) {
		ArrayList<ArrayList<Integer>> res = new ArrayList<ArrayList<Integer>>();
		if(num == null || num.length == 0) return res;
		Map<Integer, Integer> num2count = new HashMap<Integer, Integer>();
		for(int temp : num) {
			if(num2count.containsKey(temp)) num2count.put(temp, num2count.get(temp)+1);
			else num2count.put(temp, 1);
		}
		tryNext(res, num2count, new int[num.length], 0);
		return res;
	}