public void dfs(int[] candidate, List<Integer> temp, int begin, int target, int sum, int k) {
        if (temp.size() == k) {
            if (sum == target) {
                res.add(new ArrayList<>(temp));
            }
            return;
        }
        for (int i = begin; i < candidate.length; ++i) {
            int total = sum + candidate[i];
            if (total > target)
                return;
            temp.add(candidate[i]);
            dfs(candidate, temp, i + 1, target, total, k);
            temp.remove(temp.size() - 1);
        }
    }