LeetCode 1818. Minimum Absolute Sum Difference | Medium | 🏆 Weekly Contest 235 | Algorithm Explained

preview_player
Показать описание
I used lower bound to solve this problem. Once the idea is clear then it's all about implementing the lower bound.

Help the channel grow :)
1 Like = more reach
1 Subscribe = more growth

Thanks for watching friends.
Please like and share with your friends it will give me motivation to make further videos.

-------------------------------Connect with me at-------------------------------
Рекомендации по теме
Комментарии
Автор

This code will fail the second last TC. To pass that TC, we need to return (M + sum - bestSave)%M in the end, instead of (sum - bestSave)%M.

sakshiramsinghani
Автор

Finally I got a Indian who make video solutions of leetcode contest 👍 keep it up

garvitkumargupta
Автор

Thanks very much!! I understood the concept and learned new concept : lower bound.

suwin
Автор

Nice explanation sir...doing a great job

paragroy
Автор

Awesome Explanation, please make more videos like this.

gautamarora
Автор

bro its not working on leetcode some test cases are giving error

anmolsharma
Автор

nice approach ... in this i took maxdif in diff[] and replace with minimum possible max diff by checking each value... but endup getting it wrong for some test case....

himansumaurya
Автор

Solution is cool, but sir do you think in interview will they allow us to use inbuilt lower bound?
or we have to write whole code for that?

sainikhil
Автор

Thanks for the very clear explaination, It seems leetcode has added some new cases that your code will fail. Could you please check any bugs? Really want to know the problem,

terryliu
Автор

Bro Leetcode has added new test cases and 50th test case is failing pls see and reply

KB-zgho
Автор

Hlo sir the best difference for 3rd number in nums2 which is 5 its lowerbound will be 7 in nums1 so best diff will be 2 :|

yatinarora
Автор

java dont have these lower bound fucntion

saunaknandi
Автор

this solution is failing at 50th test case ( new added)

abhijitburman