LeetCode 698. Partition to K Equal Sum Subsets

  Рет қаралды 4,931

Happy Coding

Happy Coding

Күн бұрын

Пікірлер: 13
@SHASHANKRUSTAGII
@SHASHANKRUSTAGII 3 жыл бұрын
This is one of the most toughest problem
@wendyhu6988
@wendyhu6988 2 жыл бұрын
Really impressive explanation!!
@john_rambo_27098
@john_rambo_27098 4 жыл бұрын
Excellent work!!!! Really liked the breakdown.
@happycoding1093
@happycoding1093 4 жыл бұрын
You are welcome!
@bhumikaumar5303
@bhumikaumar5303 2 жыл бұрын
Is there any explaination for DP solution for this problem
@janmejaysingh7402
@janmejaysingh7402 4 жыл бұрын
Nice explanation. Watched it again after one month and it is even more clear, I have only one question. Why this problem is classified in DP in leetcode?
@happycoding1093
@happycoding1093 4 жыл бұрын
because this problem can also be solved by using DP + bit mask. I just wrote the solution here: @lru_cache(None) def dp(k, mask, remain): if k == 0: return True ans = False for i in range(n): if mask & (1
@RAHULRAJ-rv4ng
@RAHULRAJ-rv4ng 2 жыл бұрын
@@happycoding1093 Hi, Where have you done the memoization ? You have just used the name of functon as DP.
@learner_1228
@learner_1228 3 жыл бұрын
what is the time complexity of the this solution?
@happycoding1093
@happycoding1093 3 жыл бұрын
O(k^(N-k)*k!)
@learner_1228
@learner_1228 3 жыл бұрын
@@happycoding1093 Could you explain it how? Shouldn't it be O((2^n)*k)? since we will include a particular/current element or not,therefore 2 choices for every element, we will do it for k times. Is this correct?
LeetCode 140. Word Break II
25:52
Happy Coding
Рет қаралды 417
If people acted like cats 🙀😹 LeoNata family #shorts
00:22
LeoNata Family
Рет қаралды 25 МЛН
Миллионер | 3 - серия
36:09
Million Show
Рет қаралды 2,1 МЛН
When Cucumbers Meet PVC Pipe The Results Are Wild! 🤭
00:44
Crafty Buddy
Рет қаралды 60 МЛН
Mastering Dynamic Programming - How to solve any interview problem (Part 1)
19:41
Shortest Subarray with Sum at Least K | Leetcode 862
21:31
Techdose
Рет қаралды 38 М.
How I Mastered Data Structures and Algorithms in 8 Weeks
15:46
Aman Manazir
Рет қаралды 103 М.
How to STUDY so FAST it feels like CHEATING
8:03
The Angry Explainer
Рет қаралды 1,9 МЛН
Making an Algorithm Faster
30:08
NeetCodeIO
Рет қаралды 151 М.
Subarray Sum Equals K - Prefix Sums - Leetcode 560 - Python
15:19
If people acted like cats 🙀😹 LeoNata family #shorts
00:22
LeoNata Family
Рет қаралды 25 МЛН