Please watch our new video on the same topic: kzitem.info/news/bejne/p2-ZnYCmi4yIiYY
@rushidesai2836
3 ай бұрын
This better approach is pretty smart I must say. Array is visualized just using two variables, amazing.
@balakrishnanr648
Жыл бұрын
15:47 - for better SEO. This is why I like striver RAJ, Straightforward, upto point and honest. Really good to be like that, helps in longer run.
@amitranjan6998
Жыл бұрын
It's the hard problem on leetcode and you solved it brilliantly , hats off !!
@VinayakAsati-k9d
Жыл бұрын
link please
@pranavJha93
11 ай бұрын
@@VinayakAsati-k9d search krle bhai
@mohit5963
11 ай бұрын
you expain it in a such easy manner, so good Striver...
@cinime
Жыл бұрын
Understood! Super wonderful explanation as always, thank you very very much for your effort!!
@anshsaxena7297
20 күн бұрын
UnderStood, Wanted to learn this from a long long time.
@smrutisitikanta2664
2 ай бұрын
What a brilliant approach!!!
@pratyushtripathi1728
10 ай бұрын
बहुत सही गुरु जी जलवा है आपका 😂
@stith_pragya
7 ай бұрын
Thank You Much for this wonderful video...................🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻
@001_bajpai5
8 ай бұрын
If You do this bruteforce in Pyhton language then your all test cases will pass python is really good language
@dineshdsv7815
10 ай бұрын
Thanks for the detailed explanation
@adityarajvermaa
Жыл бұрын
i coded the first part by myself fully,,,,,but the second part i could not get the logic of storing in variables at first........but then i get the logic
@khanra17
7 ай бұрын
How is this binary search ? I could have solved it, its very simple linear process. But because its inside binary search i stuck finding Binary Search approach.
@theonlyarjun
7 ай бұрын
same :/
@theonlyarjun
7 ай бұрын
My bad the optimal approach is using BS, it's a separate video :(
@Yogamindmastery
22 күн бұрын
Beautiful
@crazybro4383
4 ай бұрын
class Solution { public: double findMedianSortedArrays(vector& nums1, vector& nums2) { int n2 = nums2.size(); int n1 = nums1.size(); if(n2 2 int mid2 = left - mid1; int l1 = INT_MIN; int l2 = INT_MIN; int r1 = INT_MAX; int r2 = INT_MAX; if(mid1 = 0) l2 = nums2[mid2 - 1]; if(r1>=l2 && r2>=l1){ if((n1+n2)%2 != 0){ //odd return max(l1, l2); } else{ return double(max(l1, l2) + min(r1, r2))/2.0; } } else if(l1 > r2){ high = mid1-1; } else{ low = mid1+1; } } return -1; } }; This is throwing tle, can someone explain the reason and correct the code
@NazeerBashaShaik
5 ай бұрын
Understood, thank you.
@akshatpandey2256
Жыл бұрын
where was binary search in this problem striver?
@nikhilkumarjamwal5322
10 ай бұрын
Me thinking of that too. Ain't this normal array question???
@shreyxnsh.14
8 ай бұрын
watch the optimal solution dude
@shivamgupta-yz6pc
10 ай бұрын
its still giving partially accepted
@stable577
2 ай бұрын
how to make notes of these lectures?
@omkarshendge5438
2 ай бұрын
i did not understand the count method for looking index 1 and index 2, untill then it was fine but then what are looking for like how index 1 will be that element only ??
@vaishnavejp9247
2 ай бұрын
you can actually break once you found both ind1 and ind2 elements. im not sure why he didnt do it. index1 will be that element only because count will only get incremented after you find it. you will ONLY reach index1 count once and only once.
@dewanandkumar8589
6 ай бұрын
Understood
@sanketatmaram
22 күн бұрын
understood!
@YourCodeVerse
9 ай бұрын
Understood✅🔥🔥
@per.seus._
Жыл бұрын
UNDERSTOOD
@Learnprogramming-q7f
7 ай бұрын
Thank you Bhaiya
@petersooley3362
10 ай бұрын
"here comes the twist"
@shaikimran3780
Күн бұрын
Do the code using O(1) space
@sahilkumar1521
Жыл бұрын
update this video link on website
@abhinanda7049
Жыл бұрын
understood
@DeepakPatel-d5v
4 ай бұрын
Thanks a lot Bhaiya
@arpitbhavsar6020
Жыл бұрын
Understood
@v1dhn
3 ай бұрын
If someone is looking for a less redundant code: class Solution: def findMedianSortedArrays(self, nums1: List[int], nums2: List[int]) -> float: n1,n2 = len(nums1),len(nums2) n = n1+n2 ind1,ind2 = n//2-1,n//2 count = 0 i,j = 0,0 while i
@Shivi32590
Ай бұрын
understood
@SYCOA12CHAITANYAASOLE
3 ай бұрын
Understood !! 😎😎
@karansunilkumbhar2114
3 ай бұрын
what is time complexity of this solution ?,is it O(m+n) ? if yes then how to solve this in O(log(m)+log(n))?
@deepakjain4481
Ай бұрын
The complexity you are mentioning is logm*n that is not asked
@deepakjain4481
Ай бұрын
It's log(m+n)
@VikasSharma-eg8mc
Жыл бұрын
🔥🔥🔥🔥🔥
@pushkarsingh2162
Күн бұрын
Bhai sahi mein tera questions ⁉️😅saarein galat hai 😅
@shubhrajit2117
3 ай бұрын
At 2:16 I thought I'd have to discard the common element 🤦🏻♂
@NitaiGauranga-ss8gp
4 ай бұрын
Understand ❤🎉
@Mahanth.
2 ай бұрын
fun fact in better approach : cnt is nothing but i + j
@girikgarg8
Жыл бұрын
Done
@sidharthsharma341
Жыл бұрын
Bhaiya which topic will come next ?.....what are upcoming plans
@AdityaRoy-p4i
Жыл бұрын
Yay🤩
@dayashankarlakhotia4943
Жыл бұрын
Public class solution { Public static double median (int []a,int []b){ int m=a.length, n=b.length; int i=0,j=0 m1=0,m2=0; for(int count =0;count b[j]){ m1=b[j++]; }else { m1=a[i++]; } } elseif(i
@kavyabanka4482
Жыл бұрын
It seems like complicate to me
@dayashankarlakhotia4943
Жыл бұрын
this is simple solution why complicated dryrun than understood
@Algorithmswithsubham
Жыл бұрын
❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤
@puneetgared
Жыл бұрын
@striver Why not put the OR condition in while loop instead of running while loop separately while merging the array? like while(i< arr1.length || j < arr2.length){
@sanjana6931
8 ай бұрын
thought the same!
@farazahmed7
11 ай бұрын
No BS
@pushkarsingh2162
2 күн бұрын
Bhai question to durr ki baat hai English thodi control mein kar 😢
Пікірлер: 69