Тёмный

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

Aryan Mittal
Подписаться 45 тыс.
Просмотров 6 тыс.
50% 1

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/aryan-0077
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

Опубликовано:

 

1 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 29   
@brp3522
@brp3522 28 дней назад
9:23 *Holiday bgm playinh*
@user-rk9pk9dm4z
@user-rk9pk9dm4z 28 дней назад
Your Teaching Style is Awesome!!! In love with data structures... & appreciate your consistency of uploading daily videos. Keep Going Bruh.. Well wishes.....
@varunjain3947
@varunjain3947 27 дней назад
Thankyou bro i couldn't understand this question earlier but you really make it so simple
@qwerty_ra_ungamma
@qwerty_ra_ungamma 28 дней назад
Bro, Improve the Audio quality🙂🙂
@ARYANMITTAL
@ARYANMITTAL 28 дней назад
Yaa it is pretty bad this time, i'll surely correct it ❤
@sanketbhagat1222
@sanketbhagat1222 27 дней назад
Thanks for providing quality content.
@manishprasad8736
@manishprasad8736 28 дней назад
Thank you bhai!! Great explanation!!
@purushottamnitwarangal9263
@purushottamnitwarangal9263 27 дней назад
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
@italk-gj5kk
@italk-gj5kk 27 дней назад
salute to your efforts for providing an optimised code as well...
@cenacr007
@cenacr007 27 дней назад
Keep up the good work, your daily videos motivate e to do leetcode daily
@kaustubhpathak5012
@kaustubhpathak5012 28 дней назад
best explanation so far
@hardikpatel352
@hardikpatel352 27 дней назад
Thanks a lot
@asthajain2511
@asthajain2511 28 дней назад
Your efforts sir😇
@bhamidipatisatwik1165
@bhamidipatisatwik1165 26 дней назад
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
@user-fl5sw8op1g
@user-fl5sw8op1g 28 дней назад
its crazy i was looking for this only
@user-fl5sw8op1g
@user-fl5sw8op1g 28 дней назад
wait its qs of the day
@santhosh7042
@santhosh7042 28 дней назад
bhaiya please explain the binary search approach
@abytespaceneeded
@abytespaceneeded 27 дней назад
💝💝💝💝
@vickyroy3595
@vickyroy3595 28 дней назад
Aryan Missing Goldman sachs Tee!!😂❤
@30sunique78
@30sunique78 20 дней назад
☕ Tea or Tee ?
@ayaaniqbal3531
@ayaaniqbal3531 28 дней назад
bro can we also do the above problem in O(N) Time Complexity ?
@6mahine_mein_google
@6mahine_mein_google 28 дней назад
heap approach is in O(N) time
@ayaaniqbal3531
@ayaaniqbal3531 28 дней назад
@@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 27 дней назад
@@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 27 дней назад
@@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
@AdityaDhage-1603
@AdityaDhage-1603 28 дней назад
1st Comment
@ARYANMITTAL
@ARYANMITTAL 28 дней назад
❤️❤️🫡
@naveroo11
@naveroo11 16 дней назад
class Solution { public: int minDifference(vector& nums) { int n = nums.size(); if(n
@worldofgaming748
@worldofgaming748 27 дней назад
itni garmi mein ye kya phn rakah hai
Далее
Sort an Array - Leetcode 912 - Python
17:13
Просмотров 35 тыс.
Database Sharding and Partitioning
23:53
Просмотров 73 тыс.
NOOOOO 😂😂😂
00:15
Просмотров 6 млн
Stack vs Heap Memory - Simple Explanation
5:28
Просмотров 210 тыс.
How to Solve ANY LeetCode Problem (Step-by-Step)
12:37
Просмотров 149 тыс.
Top 7 Algorithms for Coding Interviews Explained SIMPLY
21:22
NOOOOO 😂😂😂
00:15
Просмотров 6 млн