Combination Sum II | Leetcode 40 | Leetcode Daily challenge

preview_player
Показать описание
Timestamps:
Problem discussion: 00:00
approaching the problem: 01:05
dry run: 06:52
code explanation: 25:07
complexity analysis: 25:57

Time Complexity : O(2^n)
Space Complexity : O(n)

Please like, share and subscribe if you found the video useful. Feel free to ask in comments section if you have any doubts. :)

#DataStructuresAndAlgorithms
#Leetcode
#interviewpreparation
#AyushiSharma
Combination Sum II solution
Combination Sum II Leetcode
Combination Sum II C++
Combination Sum II Java
Combination Sum II Python

🔥🔥🔥🔥👇👇👇

Checkout the series: 🔥🔥🔥
LIKE | SHARE | SUBSCRIBE 🔥🔥😊
Рекомендации по теме
Комментарии
Автор

Thanks for putting in such great efforts and time for creating such in depth explanation videos it helps a lot 😀
but the java code was not really clear to me i missed somethings in it
if feasible for you can you please create a short video on that part

sarthakagarwal
Автор

Damn! A few hours back I was bit upset that I couldn't find ur video soln for today's LC daily, but now here we go! :)

shanmukhtejareddy
Автор

private void solve(int[]candidates, int target, List<Integer>cur, List<List<Integer>ans, int idx){
if(target<0) return;
if(target==0)
ans.add(new ArrayList<>(cur));
return;
for(int

continue;
cur.add(candidates[i]);
solve(candidates, target-candidates[i], cur, ans, i+1);
cur.remove(cur.size()-1);
}
}
public List<List<Integer>>combinationSum2(int[]candidates, int target){
List<List<Integer>>ans=new ArrayList<>();
Arrays.sort(candidates;
solve(candidates, target, new ArrayList<>(), ans, 0);
return ans;
}🎉❤

dayashankarlakhotia
join shbcf.ru