void combinationSum2Rec(int [] num, int target, int start, Deque<Integer> deque){
        if(target == 0){
            res.add(new ArrayList<Integer>(deque));
            return;
        }else if(target < 0) return;

        for(int i = start; i < num.length; ++i){
            // note that i > start makes sure the first element can be used in certain level
//            if(i > start && num[i] == num[i-1]) continue;
            deque.add(num[i]);
            combinationSum2Rec(num, target-num[i], i+1, deque);
            deque.removeLast();
            while(i < num.length - 1 && num[i] == num[i+1]) ++i;
        }
    }