private void helper(int[] candidates, int idx, int target, List<Integer> tempList, List<List<Integer>> result) {

    System.out.println(tempList);

    if (target == 0) {
      result.add(new ArrayList<Integer>(tempList));
    }

    if (target < 0 || idx < 0) {
      return;
    }

    for (int i = idx ; i >= 0 ; i--) {
      tempList.add(0, candidates[i]);
      helper(candidates, i - 1, target - candidates[i], tempList, result);
      tempList.remove(0);

      // all the cases for second 1 will be covered by first
      // think throughout and carefully
      while (i - 1 >= 0 && candidates[i] == candidates[i - 1]) {
        i--;
      }
    }
  }