1509. Minimum Difference Between Largest and Smallest Value in Three Moves | Heap | Sorting | Greedy

  Рет қаралды 5,920

Aryan Mittal

Aryan Mittal

Күн бұрын

In this video, I'll talk about how to solve Leetcode 1509. Minimum Difference Between Largest and Smallest Value in Three Moves | Sorting | Greedy
Let's Connect:
📱Discord (Join Community) : / discord
📝Linkedin: / aryan-mittal-0077
📸 Instagram: / codewitharyanbhai
💻 Twitter - / aryan_mittal007
🤖 Github: github.com/ary...
About Me:
I am Aryan Mittal - A Software Engineer in Goldman Sachs, Speaker, Creator & Educator. During my free time, I create programming education content on this channel & also how to use that to grow :)
✨ Hashtags ✨
#programming #Interviews #leetcode #faang #maang #datastructures #algorithms

Пікірлер: 28
@cenacr007
@cenacr007 3 ай бұрын
Keep up the good work, your daily videos motivate e to do leetcode daily
@purushottamnitwarangal9263
@purushottamnitwarangal9263 3 ай бұрын
I think there is better approach without using any higher order data structure as below : int minDifference(vector& nums) { sort(nums.begin(),nums.end()); int n=nums.size(); int ans=INT_MAX; if(n
@varunjain3947
@varunjain3947 3 ай бұрын
Thankyou bro i couldn't understand this question earlier but you really make it so simple
@sanketbhagat1222
@sanketbhagat1222 3 ай бұрын
Thanks for providing quality content.
@user-rk9pk9dm4z
@user-rk9pk9dm4z 3 ай бұрын
Your Teaching Style is Awesome!!! In love with data structures... & appreciate your consistency of uploading daily videos. Keep Going Bruh.. Well wishes.....
@italk-gj5kk
@italk-gj5kk 3 ай бұрын
salute to your efforts for providing an optimised code as well...
@brp3522
@brp3522 3 ай бұрын
9:23 *Holiday bgm playinh*
@manishprasad8736
@manishprasad8736 3 ай бұрын
Thank you bhai!! Great explanation!!
@bhamidipatisatwik1165
@bhamidipatisatwik1165 3 ай бұрын
just want to know the difference in time and space complexity between nth element and partial_sort approach in c++ vs this approach afaik nth element in c++ uses partition method of quick sort so i think time complexity is same as this and what about space complexity
@YashiGupta-r8g
@YashiGupta-r8g 3 ай бұрын
its crazy i was looking for this only
@YashiGupta-r8g
@YashiGupta-r8g 3 ай бұрын
wait its qs of the day
@qwerty_ra_ungamma
@qwerty_ra_ungamma 3 ай бұрын
Bro, Improve the Audio quality🙂🙂
@ARYANMITTAL
@ARYANMITTAL 3 ай бұрын
Yaa it is pretty bad this time, i'll surely correct it ❤
@hardikpatel352
@hardikpatel352 3 ай бұрын
Thanks a lot
@santhosh7042
@santhosh7042 3 ай бұрын
bhaiya please explain the binary search approach
@asthajain2511
@asthajain2511 3 ай бұрын
Your efforts sir😇
@vickyroy3595
@vickyroy3595 3 ай бұрын
Aryan Missing Goldman sachs Tee!!😂❤
@30sunique78
@30sunique78 3 ай бұрын
☕ Tea or Tee ?
@naveroo11
@naveroo11 3 ай бұрын
class Solution { public: int minDifference(vector& nums) { int n = nums.size(); if(n
@ayaaniqbal3531
@ayaaniqbal3531 3 ай бұрын
bro can we also do the above problem in O(N) Time Complexity ?
@6mahine_mein_google
@6mahine_mein_google 3 ай бұрын
heap approach is in O(N) time
@ayaaniqbal3531
@ayaaniqbal3531 3 ай бұрын
@@6mahine_mein_google i don't think so because a single element take logN and N element will take NlogN
@6mahine_mein_google
@6mahine_mein_google 3 ай бұрын
@@ayaaniqbal3531 here logN factor comes in because of the size of the heap but heap size is never more than 4 which means TC is Nlog4 , u can omit log4 as its a constant , thats why TC is O(N)
@ayaaniqbal3531
@ayaaniqbal3531 3 ай бұрын
@@6mahine_mein_google but bro that is space complexity and I am talking about Time complexity because to get that four element we have to go to each aray element and thus NlogN
@abytespaceneeded
@abytespaceneeded 3 ай бұрын
💝💝💝💝
@AdityaDhage-1603
@AdityaDhage-1603 3 ай бұрын
1st Comment
@ARYANMITTAL
@ARYANMITTAL 3 ай бұрын
❤️❤️🫡
@worldofgaming748
@worldofgaming748 3 ай бұрын
itni garmi mein ye kya phn rakah hai
😜 #aminkavitaminka #aminokka #аминкавитаминка
00:14
Аминка Витаминка
Рет қаралды 1,1 МЛН
啊?就这么水灵灵的穿上了?
00:18
一航1
Рет қаралды 54 МЛН
Life hack 😂 Watermelon magic box! #shorts by Leisi Crazy
00:17
Leisi Crazy
Рет қаралды 79 МЛН
Viral Video of a Man's Crazy Job Interview
16:02
Darryl Vega TV
Рет қаралды 1,3 МЛН
10 years of coding in 13 minutes
13:28
Joma Tech
Рет қаралды 4,9 МЛН
Stop using std::vector wrong
23:14
The Cherno
Рет қаралды 109 М.
Is Computer Science still worth it?
20:08
NeetCodeIO
Рет қаралды 400 М.
😜 #aminkavitaminka #aminokka #аминкавитаминка
00:14
Аминка Витаминка
Рет қаралды 1,1 МЛН