896. Monotonic Array - JavaScript
5:17
How to find job in USA?
9:43
Жыл бұрын
Пікірлер
@rahulthilak3730
@rahulthilak3730 4 күн бұрын
which is the whiteboard that you use?
@Olayiwolaibrahim-rh2rh
@Olayiwolaibrahim-rh2rh 13 күн бұрын
what's time complexity of this solution?? well I think it should be 0(n^2) because i can see more than 2 nested loops here
@aVANcation
@aVANcation 29 күн бұрын
Thank you very much! Such a clever solution, I appreciate you sharing and walking through it!
@YuriyParaska
@YuriyParaska Ай бұрын
Thanks very much for explaining what need to do in this tesk! because I couldn't understand. After you explained, it helped me.
@Ankit1504kumar
@Ankit1504kumar Ай бұрын
we can sort the array and then we can just apply one condition if {array[i] == array[i+1] } then we return true else false , in that case we would be having a space complexity of O(1) .
@KarthikNandam-xs4qn
@KarthikNandam-xs4qn Ай бұрын
Use the switch statement instead of if's and also use the IsNAN method for better runTime var evalRPN = function(tokens) { let stack = []; for(let i = 0 ; i< tokens.length ; ++i){ const token = tokens[i]; if(isNaN(Number(token))){ let second = stack.pop(); let first = stack.pop(); let val = 0; switch(token){ case '+' : val = first + second ; break; case '-' : val = first - second; break ; case '*' : val = first * second; break; case '/' : val = Math.trunc(first / second); break; default : return false; } stack.push(val); } else stack.push(Number(token)); } return stack.pop(); };
@astha4978
@astha4978 Ай бұрын
Explanation is top notch make more problem explanation in javaScript ✨
@rahulraut7371
@rahulraut7371 2 ай бұрын
Was searching for this solution and i am glad i found it. Thank you so much!! Explained very well.
@LeetCodeWithMonu
@LeetCodeWithMonu 2 ай бұрын
Thank you. Good luck for your job search.
@HamzaKhan-yz1ff
@HamzaKhan-yz1ff 2 ай бұрын
Wrong solution
@hanibal43
@hanibal43 2 ай бұрын
it seemed a little convoluted to have i be delcared atop for the block sope why not just have it in if block for when you want to redfine the prefix
@tiger7858
@tiger7858 2 ай бұрын
😂You finally remembered your KZbin password
@hellojits
@hellojits 2 ай бұрын
nice one😅
@rutikkhandekar2518
@rutikkhandekar2518 2 ай бұрын
Great Explaination.... Keep it up. we need you 🙌🙌
@LeetCodeWithMonu
@LeetCodeWithMonu 2 ай бұрын
Thank you, I will
@IshaZaka
@IshaZaka 2 ай бұрын
Thankyou for making in javascript , learning alot from your tutorials
@LeetCodeWithMonu
@LeetCodeWithMonu 2 ай бұрын
Thanks a lot. Follow for new tutorials. 😇
@bvfromruvitaliy
@bvfromruvitaliy 2 ай бұрын
You did a great job of explaining this! Thank you!
@LeetCodeWithMonu
@LeetCodeWithMonu 2 ай бұрын
Thanks a lot. Please follow for more such contents. 😇
@noorb374
@noorb374 2 ай бұрын
why adding plus 1 in it?
@noorb374
@noorb374 2 ай бұрын
great work , thankyou its so helpful please make more atleast blind 75
@LeetCodeWithMonu
@LeetCodeWithMonu 2 ай бұрын
I have added more videos to the Blind 75 Leetcode linked below. kzbin.info/aero/PL3eqOYN9nzwVgF082t-3yIkdxOWtBFL7f
@IshaZaka
@IshaZaka 2 ай бұрын
i am little confuse here, its not only two lists as mention in the problem that it is k number of lists, which means more than 2 as well, so how we are doing it with just comparing two lists
@IshaZaka
@IshaZaka 2 ай бұрын
great job sis
@LeetCodeWithMonu
@LeetCodeWithMonu 2 ай бұрын
Thanks a lot. Please follow for more such contents. 😇
@mahmoudaidia3625
@mahmoudaidia3625 2 ай бұрын
Hey, it's a great channel for DSA. I have sent you a connection request on linkedIn. I hope you accept it.
@varunrawat5654
@varunrawat5654 2 ай бұрын
Your solution was easy and understandable. I Appreciate that. Thanks
@LeetCodeWithMonu
@LeetCodeWithMonu 2 ай бұрын
Thanks a lot. Please follow for more such contents. 😇
@Sachinganeshkar-m5h
@Sachinganeshkar-m5h 2 ай бұрын
It took me about 2 hour to understand this logic by watching over and over again.. Even after looking at solution ,can't recreate it. where am i going wrong?
@Fido1hn
@Fido1hn 3 ай бұрын
Thank you for this. ❤
@LeetCodeWithMonu
@LeetCodeWithMonu 2 ай бұрын
Thanks a lot. Please follow for more such contents. 😇
@abhashsingh6293
@abhashsingh6293 3 ай бұрын
superb video
@LeetCodeWithMonu
@LeetCodeWithMonu 2 ай бұрын
Thanks a lot. Please follow for more such contents. 😇
@a2m2tkyo
@a2m2tkyo 3 ай бұрын
This is O(nLOGn), the problem requested to do under that. I also did this solution at first but I am looking for a way to do it under nLogn
@pasumarthiashik1099
@pasumarthiashik1099 4 ай бұрын
but taking a prefix sum would mean using subarray (contagious part of array) - but this is not subsequence
@HappyBoaSnake-xp8vf
@HappyBoaSnake-xp8vf 4 ай бұрын
You were saying (sum % 2) will be 1 but how, it will be 0 na ? and
@OdradasMarch2027
@OdradasMarch2027 4 ай бұрын
Your approach and explanation to this problem is simple and best. No any jargon. Better than many top online educators. 🤟💌
@LeetCodeWithMonu
@LeetCodeWithMonu 2 ай бұрын
Thanks a lot. Your comment is really inspiring for me to create more helpful videos. Keep supporting. 😇
@Vlad1998996
@Vlad1998996 4 ай бұрын
thx a lot
@LeetCodeWithMonu
@LeetCodeWithMonu 2 ай бұрын
Thanks a lot. Please follow for more such contents. 😇
@1030Celtic
@1030Celtic 4 ай бұрын
with regex you can create a capturing group using the space and then apply reverse/join. Runtime is very low - s.trim().split(/\s+/g).reverse().join(' ')
@anirbansarkar7916
@anirbansarkar7916 4 ай бұрын
Hi I just started learning DSA and its really helped me to understand this problem easily and that's for coding in js as there is very limited resource out there
@LeetCodeWithMonu
@LeetCodeWithMonu 2 ай бұрын
Thanks a lot. Please follow for more such contents. 😇
@mkunboxing
@mkunboxing 4 ай бұрын
hey my name is also monu wow
@LeetCodeWithMonu
@LeetCodeWithMonu 2 ай бұрын
Great coincidence.
@pasumarthiashik1099
@pasumarthiashik1099 5 ай бұрын
how will that know to move right from 4 --> 5 again?
@enkhbilguunbatsaikhan6466
@enkhbilguunbatsaikhan6466 5 ай бұрын
The best explenation ive encountered so farrr
@LeetCodeWithMonu
@LeetCodeWithMonu 2 ай бұрын
Thanks a lot. Please follow for more such contents. 😇
@Vitalik186
@Vitalik186 5 ай бұрын
very nice, Thanks you
@LeetCodeWithMonu
@LeetCodeWithMonu 2 ай бұрын
Thanks a lot. Please follow for more such contents. 😇
@Ryderw93
@Ryderw93 5 ай бұрын
Euclidean algorithm, TIL
@LeetCodeWithMonu
@LeetCodeWithMonu 2 ай бұрын
Please follow for more such contents. 😇
@JaredFL
@JaredFL 5 ай бұрын
I like the first concept of changing the value to visited or even adding an additional property of the object seen: true
@LeetCodeWithMonu
@LeetCodeWithMonu 2 ай бұрын
Thanks a lot. Please follow for more such contents. 😇
@DrunkenChesssMaster
@DrunkenChesssMaster 5 ай бұрын
really liked the video keep the good work
@LeetCodeWithMonu
@LeetCodeWithMonu 2 ай бұрын
Thanks a lot. Please follow for more such contents. 😇
@saikrishnak2413
@saikrishnak2413 5 ай бұрын
Thanks for the explanation 👍
@LeetCodeWithMonu
@LeetCodeWithMonu 2 ай бұрын
Thanks a lot. Please follow for more such contents. 😇
@sanjive05
@sanjive05 5 ай бұрын
Thanks for this Solution ... ! Which microphone you using for recording this audio ?
@LeetCodeWithMonu
@LeetCodeWithMonu 2 ай бұрын
Thanks a lot. Please follow for more such contents. 😇 I am not using any external microphone. I record using mac recorder and its inbuilt microphone.
@naive-fleek7420
@naive-fleek7420 6 ай бұрын
what a misleading video? where are the questions? why faking accent ?
@LeetCodeWithMonu
@LeetCodeWithMonu 2 ай бұрын
It is not misleading and the questions are not published by Google online or anywhere. It is people like us who go through the interview process and share their experience. There are few takeaways that I got from the interview even though I did not ace it. I can show you the proof of interview if you demand.
@hiraanny8238
@hiraanny8238 6 ай бұрын
its too helpfull
@LeetCodeWithMonu
@LeetCodeWithMonu 2 ай бұрын
Thanks a lot. Please follow for more such contents. 😇
@ZakTheCreator
@ZakTheCreator 6 ай бұрын
amazing, easy to understand explanation in javascript!!!
@LeetCodeWithMonu
@LeetCodeWithMonu 2 ай бұрын
Thanks a lot. Please follow for more such contents. 😇
@RavindraSingh-zg9eq
@RavindraSingh-zg9eq 6 ай бұрын
Thank you so much for optimized solution and explanation , expecting more content like this
@faustotapia6495
@faustotapia6495 6 ай бұрын
Excellent explanation, I got asked this question in an interview but came up with a very inefficient solution.
@LeetCodeWithMonu
@LeetCodeWithMonu 2 ай бұрын
No problem. Keep learning and you will ace the interviews one day soon. I hope you have already aced one. Let me know how it went.
@darshitgajjar5199
@darshitgajjar5199 6 ай бұрын
Pls make more video, Good Content :-)
@LeetCodeWithMonu
@LeetCodeWithMonu 2 ай бұрын
Thanks a lot. I am adding more new videos to my playlists. Please follow for more contents. 😇
@nguyeny2141
@nguyeny2141 6 ай бұрын
thanks you about content
@LeetCodeWithMonu
@LeetCodeWithMonu 2 ай бұрын
Thanks a lot. Please follow for more such contents. 😇
@svmyt655
@svmyt655 6 ай бұрын
will the o(m+n) code work if the array contains negative integers .
@aVANcation
@aVANcation 29 күн бұрын
Yes, it works for arrays containing negative numbers.
@freecourseplatformenglish2829
@freecourseplatformenglish2829 6 ай бұрын
intution is missing. Please explain why slow and fast meet at loop start in 2nd part.
@TH3BUSH1D0
@TH3BUSH1D0 6 ай бұрын
your mic is way too quiet
@LeetCodeWithMonu
@LeetCodeWithMonu 2 ай бұрын
Thanks for pointing that out. I will keep that in mind the next time I create any video. 😇
@kinnikuchu
@kinnikuchu 7 ай бұрын
Very well explained, much better than in bigger channels. Thank you!
@LeetCodeWithMonu
@LeetCodeWithMonu 2 ай бұрын
Thanks a lot. Please follow for more such contents. 😇