You have a God gifted talent of intelligence and explaining it so simply. Than you so much🎉
@prathmeshkakde37316 ай бұрын
True ,wish I had teacher like him earlier!!!!
@ramandeepsingh84646 ай бұрын
Please don't stop posting video and if you have time then please do contest discussion also
@manibhushankumarsingh51966 ай бұрын
00:07 Find the longest continuous subarray with an absolute difference less than or equal to a given limit 02:12 Finding the longest continuous subarray with absolute difference less than or equal to limit. 06:23 To validate a sub-array, find the difference between its maximum and minimum elements. 08:27 Identifying valid subarrays based on difference limit. 12:38 Using a heap can efficiently track the minimum element within the window. 14:43 Implementing window sliding technique for efficient computation 18:33 Analyzing subarrays based on element limits 20:47 Algorithm for finding longest continuous subarray with absolute difference less than or equal to limit 24:13 Dry runs help in gaining clarity for solving problems. 25:59 Understanding the shifting of elements in the max and min heaps during traversal. 29:41 Finding valid subarrays with absolute difference less than limit. 31:40 Iterating through the array and checking limits for valid subarrays 35:40 Algorithm for finding longest continuous subarray with absolute difference less than or equal to limit 38:07 Discussed time complexity and approach for a sliding window problem 41:58 Efficient data structure for finding maximum and minimum elements with a given limit 43:50 Explanation of using Multi Set in C++ for efficient operations 47:20 Explanation of using max heap and multi set for inserting and removing elements.
@michaelmaahi73846 ай бұрын
Thank you bhai
@kaustubhchaudhari98386 ай бұрын
God Gifted Mic Bhai, Thank you for Explaining so easily
@StackUnderFlow80556 ай бұрын
today i did the first question with a multiset , amazing explanation ❤❤
@pavittarkumarazad32596 ай бұрын
Thanks, approach 2 was really amazing. I was able to solve it on my own with the 1st approach but what was more amazing was that you showed us why we need a TreeMap data structure while building the intuition.
@ShardulPrabhu6 ай бұрын
Thanks sir ❤ only question explain kr k pause krne bataya uske liye mere 😢 you care for us 😢😢 thank you so much
@anjanasahay21726 ай бұрын
Yes Please Contest problems too...the hard and medium ones❤❤
@saminaabbas97226 ай бұрын
Thank you MIK! You're the best
@manishdubey47726 ай бұрын
@codestorywithMIK Hi sir, you discuss the 2nd approach which is using the TreeMap but there also arises one problem i.e if we have all unique elements then we have to traverse through all the elements of the map as I think there is no any way to get the smallest and largest element directly in O(1) time complexity. Can you please discuss it? At last, I really like your explanation of the question problem like a story, I want to thank you for your great videos
@thefinalfit6 ай бұрын
Complete legend. Detailed each step
@floatingpoint76296 ай бұрын
thanks for the multiple dry run
@ashutoshpandey16396 ай бұрын
I have solved this prolem using multiset, I think multiset wala approach is more intuitive than using priority queue
@user13443fg6 ай бұрын
Nice you stopped writing topic name in video thumbnail. It is necessary to understand problem first and build Intuition. i hope you will not show topics in video thumbnail in your future videos as well :)
@gauravbanerjee28986 ай бұрын
Thanks a lot bhaiya ❤❤ Bohot hi pyara explanation tha 🔥
@rahulnegi40276 ай бұрын
Bhaiya pleas leetcode ke contest ke question ke solution bhi explain krdo please apki explanation boht badiya lagti h please..... waiting for the series where you will do contest problems
@gui-codes6 ай бұрын
I felt this was hard but man you explain so well.
@Lakshya-f4l6 ай бұрын
Thanks a lot sir!
@ArpitDhimaan6 ай бұрын
bro pls add time stamp in future videos. It , saves lot of time.
@23cash866 ай бұрын
Great video as always
@CodeMode93136 ай бұрын
Little correction !!!! TIme stamp 9:19 , a lil minute error , diff b/w max and min is 7 not 6
@EB-ot8uu6 ай бұрын
legit. thanks a lot legend
@imPriyansh776 ай бұрын
Great Explanation Bhaiya!!! Thank you...
@chitranshjain97146 ай бұрын
Please resume dp concept series
@venkatarohitpotnuru386 ай бұрын
Bhaiya weekend aagya..partion dp concept videos
@AnjuGupta-sz1uk6 ай бұрын
Amazing Expalnation 😊
@arjunprasad10716 ай бұрын
Great explaination! if its possible please make an explainer on the O(N) approach ie deque approach🙏🙏
@tarunsingh24806 ай бұрын
great explanation man ...
@animestuff1446 ай бұрын
Awesome explanation sir
@anshror25836 ай бұрын
Bhai aap please contest ki 3 and 4 problem discuss kara laro please bhai request h
@Vinamrasharma05236 ай бұрын
Waiting for this ❤
@DevOpskagyaan6 ай бұрын
Amazing explanation man
@surekhasonawane40456 ай бұрын
Solved using Multiset as we can get min/max in O(1) . and deletion in O(1) whenever window's absolute difference exceed limit
@gui-codes6 ай бұрын
bhai multiset jaise STLs ko kaha se parha ? Can you share any good resource.
@jitesh_khurana6 ай бұрын
@@gui-codes gfg se padhle bhai
@jitesh_khurana6 ай бұрын
int longestSubarray(vector& nums, int limit) { int ans = 1; int n = nums.size(); int i = 0; int j = 0; multiset st; while(j
@study-yd6es6 ай бұрын
Amazing Explainations!!😍
@VedBrahmbhattBEE6 ай бұрын
Awesome as always.
@ashish34876 ай бұрын
sir make some more questions video on segment tree
@chitranshjain97146 ай бұрын
amazing explanation
@SanjeevKumar-xv5lw5 ай бұрын
Why didn't we use two deques for maintaining min and Max of the window avoiding that extra log n term which comes with heap and multiset?
@aizad786iqbal6 ай бұрын
one doubt, pop should be O(1) right, as we just delete the top element.... the push is log(n) time correct ? please confirm...
@cricketsureshlucky6 ай бұрын
Thank you so much
@abhinavnarang43696 ай бұрын
bhaiya segmenr tree ki playlist continue krdo,interview h
@prakharTiwari-c8n6 ай бұрын
@codestorywithMIK , Thanks for your so detailed video but how TreeMap store duplicate value ?
@anishbishnoi29xD6 ай бұрын
i think TreeSet does not store duplicate value but TreeMap can store
@harshsingh77134 ай бұрын
Guru ji Longest Nice subarray pe solution bna do please
@manpreetsaluja36916 ай бұрын
I do it with map and sliding window concept
@cricketsureshlucky6 ай бұрын
Sir my kind request please upload a video on today's contest 3rd question. It is quite difficult solving dp.
@ramandeepsingh84646 ай бұрын
Exactly 💯
@RitikRanjan-fn9me6 ай бұрын
try to think something related to consecutive negative numbers and apply pick not pick conditions accordingly
@cp651436 ай бұрын
+1
@ManojKrVerma-vw4dx6 ай бұрын
I could solve this by sliding window and multiset.
@jitesh_khurana6 ай бұрын
Preety Good Easy Solution with multiset and sliding window int longestSubarray(vector& nums, int limit) { int ans = 1; int n = nums.size(); int i = 0; int j = 0; multiset st; while(j
@amar44296 ай бұрын
[1,5,6,7,8,10,6,5,6] limit:- 4 Answer = 5 can you explain this example please👃
@pokeindia53616 ай бұрын
Bhaiya aapne bola tha weekend pe *longest valid parantheses* ka video daaloge... Please bhaiya ye important q h interview k liye
@empvaibhav97996 ай бұрын
Solve "Leetcode : 239. Sliding Window Maximum" before attempting this.
@aizad786iqbal6 ай бұрын
i tried using in tree set in java..but it doesn't store duplicate elements..
@harmansingh7226 ай бұрын
Which notepad do you use?
@ReshuSharma-jc7yu6 ай бұрын
Sir mereko kaise pata chalega ki isme heap use hoga question main ki nhi
@akashsaurabh91966 ай бұрын
Why st.erase(st. Find(nums[i])) why not st. Erase(nums[i])??
@codestorywithMIK6 ай бұрын
There are 3 variants of erase in multiset. 1) void erase (iterator position); 2) size_type erase (const value_type& val); 3) void erase (iterator first, iterator last); If you use 1st one, it will only delete the single element pointed by the iterator position. If you use 2nd one, it will delete all occurrences of that element from the multiset. We don’t want that here because we can have duplicate elements.
@Innovision20236 ай бұрын
Bhaiya tumara linkedin id thetho i will mention u in my leetcode acheivements
@codestorywithMIK6 ай бұрын
Hey, That’s sweet of you ❤️ www.linkedin.com/in/mazhar-imam-khan-95a34ab3?
@MayankRathore-qi7qv6 ай бұрын
sir mujhe yeh max heap ur min heap wala question smghj nhi aaya
@TUSHARKHANDELWAL-i8s6 ай бұрын
this question must be marked hard
@gui-codes6 ай бұрын
sahi me yaar.
@naive-fleek74206 ай бұрын
@@gui-codes nahi yarr multiset use krte ho toh bhot easy hai , easy medium hoga
@anish.naruto6 ай бұрын
Sir, one thing i want to point out that you always take elements sorted in heaps.. But that's not always true in heaps, only the top element can be surely claimed as min or max... And heap structure changes on addition or deletion of elements to maintain that top value condition... So it's not good to talk like this that the max element will be in bottommost position in minheap or something like that. Though, i understand you're just taking that way to explain it better way but people can have misconception about heaps by this. Correct me if I'm wrong.
@ramandeepsingh84646 ай бұрын
❤
@AbhishekAnand-u7u6 ай бұрын
💥💥💥💥💥explain most optimized solution from leetcode solution section💥💥💥💥💥💥💥💥💥💥💥💥💥💥💥💥💥💥
@deepanshuverma62376 ай бұрын
rep++
@naive-fleek74206 ай бұрын
o(n) wala approach nahi bataye aap?
@varunkedia67296 ай бұрын
Question says - difference b/w any two elements Then why are we talking diff of largest and smallest?
@gui-codes6 ай бұрын
See 5:03 in the video bro. The question say difference b/w any two elements MUST not exceed limit. So, for any subarray, instead of checking diference b/w every possible 2 elements pair (if they are crossing limit or not), you can simply check if the difference between highest and lowest number in that subarray is