You taught the entire DP series so well.. that I solved both front partition problems by my own from Recursion to Tabulation, and then I am seeing this video to increase views count and also to know your approach. Thank you so much bhaiyaa ❤❤❤❤
I was going to directly watch the video, but when I saw your comment I stopped the video and tried the problem by myself and I solved it in the first attempt only without any wrong answer. Thanks for motivating me to try by myself 😄😄😄
Solved this problem Completely on my own thanks a ton for this series. Wished this series came much earlier I won't have to struggle in dp a lot. Kudos to content creators like Kartik arora and striver.
I too solved this problem on my own but checking the video to increase view count + to know Striver Bhaiya's code........This A2Z Sheet is just amazing........words are not sufficient to justify its appreciation.................Thanks a ton Striver Bhaiya.........🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻
solved this problem completely on my own thanks to your series it took me some time getting the partition and sequencing question but once i got it , it was amazingly easy.
JUST ONE MONTH BACK FRO TODAY THIS QUESTION WAS ASKED IN LEETCODE'S DAILY QUESTION AND I LEAVE IT BECOZ I DID'NT EVEN KNOW WHAT THE DP IS FROM NOW I SOLVE THIS QUESTION WITHOUT WATCHING SOLUTION IN RECURSIVE + MEMOZIATION + TABULATION METHOD JUST BECAUSE OF THIS GOAT MAN AND TEACHER STRIVER♥
Hello, thank you so much sir for the wonderful explanation of this problem, and this is the first time I'm visiting your channel and this being the first video I've watched. Immensely helpful in understanding the working of the logic and the code. Thanks a lot
Solved this problem on my own, Very grateful to you Striver Here's my Tabulation approach, class Solution { public: int maxSumAfterPartitioning(vector& arr, int k) { int n = arr.size(); vector dp(n+1, 0); for (int i=n-1; i>=0; i--) { int ans = INT_MIN; int maxy = INT_MIN; for (int j=i; j
I have a doubt in 2 questions, like in MCM question we take dp as f(i, j) --> consider what will be the answer if array is from (i to j) and here we just reduces our time complexity, and make the problem into f(i) --> what will be the answer if array starts from ith index. so can we reduce MCM problem into front partitioning problem ? If not then why?? what is the main restriction for which we can't do that problem in front partitioning manner?
Can someone answer this question Why can front partition logic cannot be applied in minimum cost to cut stick, burst balloons, evaluate boolean expression??
No......take example:- [ 1 15 13 4 4 1 ] k=3 By greedy we would want to give 15 , space of 3 means [ 15 15 15 4 4 4 ] sum=57 But [ 15 15 13 13 13 1 ] sum= 70 which is maximum you can get
Just an update : The problem link in the description points to a different question.
Thanks a lot for providing such a valuable content for free!
You taught the entire DP series so well.. that I solved both front partition problems by my own from Recursion to Tabulation, and then I am seeing this video to increase views count and also to know your approach.
Thank you so much bhaiyaa ❤❤❤❤
Same bhai same😌😌
@@PiyushSharma-ud9qk 😀😀
I was going to directly watch the video, but when I saw your comment I stopped the video and tried the problem by myself and I solved it in the first attempt only without any wrong answer. Thanks for motivating me to try by myself 😄😄😄
@@gandhijainamgunvantkumar6783 great.. ❤️😎
@VIVEK YADAV amazing 🔥
Understood and completed the entire series. This is the best series till now. Love you keep contributing for community
Solved this problem Completely on my own thanks a ton for this series. Wished this series came much earlier I won't have to struggle in dp a lot. Kudos to content creators like Kartik arora and striver.
Nice name Homeboy
This is one of the simplest dp qns
I too solved this problem on my own but checking the video to increase view count + to know Striver Bhaiya's code........This A2Z Sheet is just amazing........words are not sufficient to justify its appreciation.................Thanks a ton Striver Bhaiya.........🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻
solved this problem completely on my own thanks to your series it took me some time getting the partition and sequencing question but once i got it , it was amazingly easy.
JUST ONE MONTH BACK FRO TODAY THIS QUESTION WAS ASKED IN LEETCODE'S DAILY QUESTION AND I LEAVE IT BECOZ I DID'NT EVEN KNOW WHAT THE DP IS FROM NOW I SOLVE THIS QUESTION WITHOUT WATCHING SOLUTION IN RECURSIVE + MEMOZIATION + TABULATION METHOD JUST BECAUSE OF THIS GOAT MAN AND TEACHER STRIVER♥
UNDERSTOOD.............Thank You So Much for this wonderful video............🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻
did that que by myself , thankyou striver for this gold dp series .
was able to solve this problem on my own. Thanks striver for teaching the entire dp series so well.
was able to solve this question on my own . Thankyou Striver
To the world you are a teacher. TO YOUR STUDENTS YOU ARE A STARRR!!!!
UR the best bro!
Legendary Playlist, Thank you so much!
Wrote the code all by myself..all thanks to you
Understod!!
Thank you
Understood!!!
Awesome solution and great explanation
Thankyou for amazing solution Striver
understood very clearly thank you striver.
Was able to solve the problem on my own.
All thanks to you Bhaiya.. You have made DP very simple
As always "understood"
Solved this on my own! thank you so much
Solved this problem on my own
Thankyou so much striver ❤
thank you understood , striver
Understood, Thank you so much Striver.
This is kind of Tricky. Thankyou Sir. Understood.
Your explanation on topic like front partitions makes this concept super duper easy to understand.
Thank you striver just because of you today i am in codenation as an SDE 5
bhaiya referral dede na..
Thanks you sooo much sir for teaching us this awsome dp series, i can say this dp playlist is best ever in internet .
Hello, thank you so much sir for the wonderful explanation of this problem, and this is the first time I'm visiting your channel and this being the first video I've watched. Immensely helpful in understanding the working of the logic and the code.
Thanks a lot
Did on my own! ❣
i dont know what to say
i am so dumb in dsa and making the dp problem by my own feels so great bhaia ..
Understood❤❤❤
How can you explain this problem so easily ♥Thanks a lot.
Kya explaination the waaaaaaaaaah!!!!!!!!!1
Understood! Sooo amazing as always, thank you very much!!
Awesome series
hurray! i solved this ques by myself 😊
understood😀
you can also get the length as j - ind + 1
how do we know when we have to use front partitioning?
Understood 😊
What will be the time complexity of recursive approach?
Solved this problem on my own, Very grateful to you Striver
Here's my Tabulation approach,
class Solution {
public:
int maxSumAfterPartitioning(vector& arr, int k) {
int n = arr.size();
vector dp(n+1, 0);
for (int i=n-1; i>=0; i--) {
int ans = INT_MIN;
int maxy = INT_MIN;
for (int j=i; j
Understood, sir. Thank you very much.
understood
Understood
I have a doubt in 2 questions, like in MCM question we take dp as f(i, j) --> consider what will be the answer if array is from (i to j) and here we just reduces our time complexity, and make the problem into f(i) --> what will be the answer if array starts from ith index. so can we reduce MCM problem into front partitioning problem ? If not then why?? what is the main restriction for which we can't do that problem in front partitioning manner?
Understood!!!
what will be the TC of recursive solution without memoization?
As always "understood" ❤️
understood, very well explained
Problem link given ..is not correct 🙂
Do u know the correct problem link, can u pls share if u have.
yes, its wrong, please send the correct one.
Here you go: leetcode.com/problems/partition-array-for-maximum-sum/
can we apply greedy?
Isn't this unbounded knapsack?
Bhai this man is a god of DSA literally!
Understood Striver , Thanks a lot
Thank you so much!!
Understood,able to solve by myself
As always "understood" ❤
Problem link: leetcode.com/problems/partition-array-for-maximum-sum/
Aayee Aapka Tha Humen Intezar
@Striver Bhaiya - Why not -1 to answer as like previous Question i.e Palindrome Partioning-2 ,here also we going to last element
Great video
Can anyone Explain how to differentiate between front partition and mcm type problems?
Thanks Striver. Understood.
Understood, thanks
THANK YOU SIR.
Understood SIr!
Thanks a lot
Can someone answer this question Why can front partition logic cannot be applied in minimum cost to cut stick, burst balloons, evaluate boolean expression??
Bhaiya why we used ind+k because isse toh range badhti chli jayegi hrr iteration mai, toh wo 3 elements ko he kese select karega. (For k = 3)
Bhaiya why we used ind+k because isse toh range badhti chli jayegi hrr iteration mai, toh wo 3 elements ko he kese select karega. (For k = 3).
Best explanation ever
How to know when to go for Front partition and when to go for normal partition DP like MCM?? ...I am having a bit of difficulty in understanding this.
yes
Would the number of partitons exceed k here
Tried to solve it differently be declaring a 3D DP although it gave TLE at40/52 TC.
Thanks striver❣️
Understoooooooooooooooooooooooooooooooooooooooooodddddddddd!!!!!!!!!!!
"understood"
Understood 🙂🙂💚
is dp playlist completed ?
understood bro great explanation
understood!!
Codestudio Problem Link - www.codingninjas.com/codestudio/problems/maximum-subarray_3755255
understood!!
UNDERSTOOD
Understood !!!!!!!!!!!!!!!!!!!!!!!!
why space optimization is not working here
Because we’ll need atmost “k” independent arrays and not two. That being said, we can optimize this using “k” number of arrays.
@@vishious14 actually dont we just need k number of variables to space optimise instead of arrays as you mentioned!
understood!!!!!!!
Can anybody please tell me how to shift all selected lines(shortcut) as done at 20:22
understood
Understood 🎉
US bhaiyaa
US striver
I solved this on my own
can't we apply greedy like which element is maximum give him maximum space left
No......take example:- [ 1 15 13 4 4 1 ] k=3
By greedy we would want to give 15 , space of 3 means [ 15 15 15 4 4 4 ] sum=57
But [ 15 15 13 13 13 1 ] sum= 70 which is maximum you can get
Understood Sir.
Why aren't we using 2D dp for this problem? Can Anyone plz explain.
cuz we only need the max of the 3 partition we do so storing only that maximum is useful
understood. Super
If anyone have problem link please share
Thanks striver