Awesome Explanation Brother.... I was waiting for your video for this problem solution. This was my 2nd biweekly contest and I got stuck at this problem. It is a bit tough to digest for me but I really appreciate your time and efforts for complete in depth solution for these problems. Stay Blessed Bhaiya and thank you ..........
for a subarray [i ... j] the sum is prefSum[j] - prefSum[i - 1]. Now to maximise the sum of all subarrays we need to minimise the prefSum[i - 1] part as prefSum[j] will be fixed. That's why we are storing the minimised prefSum[i - 1] for each nums[i] in the map so that we dont need to traverse for all the duplicates.
Thanks for providing the intuition for the duplicate values. Appreciate your work
THNX bro, well explained.
Awesome Explanation Brother.... I was waiting for your video for this problem solution. This was my 2nd biweekly contest and I got stuck at this problem. It is a bit tough to digest for me but I really appreciate your time and efforts for complete in depth solution for these problems. Stay Blessed Bhaiya and thank you ..........
Were you able to come up with the 2nd?
@@ritishrai581 I couldn't submit it as I was getting stuck on one or two corner cases. That's why I was super Curious to know the solution
i used vector of indices but still passed all test cases 🙃🙃
Now it will not
ye minimize kya kr rahe hai samjh nahi aaya
for a subarray [i ... j] the sum is prefSum[j] - prefSum[i - 1]. Now to maximise the sum of all subarrays we need to minimise the prefSum[i - 1] part as prefSum[j] will be fixed. That's why we are storing the minimised prefSum[i - 1] for each nums[i] in the map so that we dont need to traverse for all the duplicates.
Jo part easy hai wo 10 baar samjata hai ye
wahi uski toh repeat karega baar 😁😁😁😁 ,tough wale part ka direct code karta hai
bhai thoda dheere bol le