Best Time To Buy & Sell Stock 1 (LeetCode 121) | Full solution with visuals and animation

  Рет қаралды 35,044

Nikhil Lohia

Nikhil Lohia

Күн бұрын

Пікірлер: 89
@movocode
@movocode 8 ай бұрын
How come your views are so low....its literally the best explanation i am getting on youtube ....already watched few of your videos...always thinking why you are so underrated.
@kyayaaromkar
@kyayaaromkar 10 ай бұрын
Why are his lectures not having enough views? They are so good.
@GeetainSaar
@GeetainSaar 5 ай бұрын
Thumbnail
@Homelander_30
@Homelander_30 4 ай бұрын
They love only clickbait and trends. He is treasure, hope he start DSA course, I will buy at any cost.
@patelg6759
@patelg6759 4 ай бұрын
​@@GeetainSaar obviously this is the main reason but once you watch you'll search NIKIL lohia
@yashrajput8566
@yashrajput8566 7 ай бұрын
one of the best yet simple solution i have seen so far.
@sreeharsharaveendra289
@sreeharsharaveendra289 11 ай бұрын
Your clear explanation is so good. Clearly this video deserves more views, bless you!
@nikoo28
@nikoo28 10 ай бұрын
thanks for your appreciation and motivation :)
@vipulaggarwal8518
@vipulaggarwal8518 3 ай бұрын
we are learning 2 things from you in every video 1. obviously problem solving 2. how to communicate efficiently. the way you express your thoughts is phenomenal your english is so simple and easy to understand I also wants to become as good as you in communication skills.
@zmonkey111
@zmonkey111 2 жыл бұрын
So happen I randomly found you. Thank you for the content. You are definitely helping me understand the coding mindset.
@MythBuster28_10
@MythBuster28_10 8 ай бұрын
This explanation deserves more views and sharing with friends and colleagues. Simply brilliant
@atmurisaimouli4697
@atmurisaimouli4697 10 ай бұрын
Mind Blowing Explaination , Very Clear and Consice
@manansarraf73
@manansarraf73 5 ай бұрын
bhaiya whenever i got stuck in DSA you always saved me. i have watched number of videos of yours on DSA and always got the best solution always
@nikoo28
@nikoo28 5 ай бұрын
It's my pleasure
@sourabhtiwari5137
@sourabhtiwari5137 10 ай бұрын
better than more phd holder, great explanation
@TheDQR
@TheDQR Ай бұрын
Great explanation, hands down one of the best videos explaining problems from leetcode, I will suscribe and keep watching more. I actually was able to resolve the problem with your explanation and not by looking at your code, and I tried to watch the solution of this problem in other videos. Thanks for the video man.
@ajayupadhyay4964
@ajayupadhyay4964 Жыл бұрын
very underrated channel
@zeus4963
@zeus4963 Ай бұрын
Litreally the best tutor i have ever got! Thank you so damn much bro!
@harshitagoswami989
@harshitagoswami989 Жыл бұрын
You are a gem!
@imrn4u
@imrn4u 3 ай бұрын
great explanation with clear and concise way.
@akankshajain3997
@akankshajain3997 Жыл бұрын
such a clean explanation with visuals, thank you!
@nikoo28
@nikoo28 Жыл бұрын
so happy you like them
@ankitajha3962
@ankitajha3962 3 ай бұрын
Was able to code on my own
@anuradhae9146
@anuradhae9146 Жыл бұрын
really appreciate your effort to explain and how to reach to solution step by steps. It is great help. keep it up!! thanks lot
@nikoo28
@nikoo28 Жыл бұрын
you are very welcome!!
@anubratsahoo447
@anubratsahoo447 4 ай бұрын
Underated teacher
@shivesh.mishra
@shivesh.mishra 4 ай бұрын
As usual I respect my teachers most but. Uh got the respect from it's peak.📈❤
@kirthananambiar8873
@kirthananambiar8873 2 жыл бұрын
Thank you for your great explanation..it will be great if you solve hackerank array manipulation problem
@enriquegrageda
@enriquegrageda 9 ай бұрын
You should be a tutor or teacher, thanks for uploading :D
@susmitapatil4847
@susmitapatil4847 9 ай бұрын
Really Good content... Best video lecture on KZbin. Keep doing good work
@bhawnachauhan4375
@bhawnachauhan4375 10 ай бұрын
You explained so well😊
@tayyabsami258
@tayyabsami258 8 ай бұрын
Brother your explanation is love
@rohitrajsingh4638
@rohitrajsingh4638 10 ай бұрын
best explanation that i found
@MuhammadAbdullahZahid-b7f
@MuhammadAbdullahZahid-b7f 5 ай бұрын
great understanding
@hoang640
@hoang640 Жыл бұрын
Very clear explaination Thank you so much
@VikashSingh-sf2xp
@VikashSingh-sf2xp 3 ай бұрын
very nice explanation.
@xzcgvxzcvxzcvxcv
@xzcgvxzcvxzcvxcv 10 ай бұрын
It's more better explanation than neetcode) thx
@riyarai9226
@riyarai9226 5 ай бұрын
Thank you so much sir, this explanation was super helpful.
@mithic
@mithic 3 ай бұрын
brother i think even if we remove the else block and write update the currentProfit directly it should still work
@manishasharma434
@manishasharma434 Жыл бұрын
Pls do cover all the parts of buy and sell problem if possible
@nikoo28
@nikoo28 Жыл бұрын
yep...I do have that on my mind 😄
@chandanaarvapally
@chandanaarvapally 4 ай бұрын
You are toooo good! Thanks a lot sir
@devotie_
@devotie_ 2 ай бұрын
😍superb explaination, tq bro 😊 tq so much😊😊😊
@ashok2089
@ashok2089 4 ай бұрын
Best explanation..thanks!
@vpvpsilly2927
@vpvpsilly2927 Жыл бұрын
great explanation....thank you sir
@lymmontijo87
@lymmontijo87 Жыл бұрын
Thank you so much, this explanation was super helpful.
@niom_002
@niom_002 9 ай бұрын
Great explanation ❤
@-IT-ARGHYASINGHA
@-IT-ARGHYASINGHA 8 ай бұрын
thank you very much sir nicely explained
@devotie_
@devotie_ 2 ай бұрын
Excellent explaination🥰❤😊 bro
@MoralStories292
@MoralStories292 6 ай бұрын
the best explanation❤❤❤❤
@iftekharanam8980
@iftekharanam8980 8 ай бұрын
Thanks man. Good coding.
@hariboy123
@hariboy123 Жыл бұрын
i love your english
@mohammadfahad6076
@mohammadfahad6076 Жыл бұрын
great explanation👍
@susanjoshi5948
@susanjoshi5948 3 ай бұрын
You are awesome!
@quantisticnumbers2633
@quantisticnumbers2633 Жыл бұрын
Thanks for the video
@aniketrawat3224
@aniketrawat3224 Жыл бұрын
Thanks, it was really helpfull...
@sudhadevi6692
@sudhadevi6692 Жыл бұрын
Bhaiya tussi GREAT ho!!!🎉
@nikoo28
@nikoo28 Жыл бұрын
you are great too :D
@isabelgraciano9282
@isabelgraciano9282 Жыл бұрын
great video and very well explained 😃
@techtoss7515
@techtoss7515 2 ай бұрын
excellent!!
@akjha627
@akjha627 9 ай бұрын
I wrote the code myself and I am confused with the test cases...[3,2,6,5,0,3] expects the output to be 4 whereas [2,1,2,1,0,1,2] expects output to be 2. So in first testcase, the 0 price is not valid whereas in the 2nd, 0 buy price is valid ??
@nikoo28
@nikoo28 8 ай бұрын
try debugging and you will be able to follow along the step you are missing
@yaswanthreddy2623
@yaswanthreddy2623 9 ай бұрын
Thankyou sir.
@TrungNguyen-eo7qz
@TrungNguyen-eo7qz 8 ай бұрын
How to find and return the indices of best day to buy and best day to sell with max profit?
@nikoo28
@nikoo28 8 ай бұрын
that is another problem...and will cover it at a later point in time
@everyontech2716
@everyontech2716 Жыл бұрын
well explained
@kidoo1567
@kidoo1567 Жыл бұрын
U are looking like that guy who host the show "the mad" in pogo❤
@nikoo28
@nikoo28 Жыл бұрын
haha...you mean rob?
@pavankumarpadamati8606
@pavankumarpadamati8606 10 ай бұрын
nice explanation ...keep it bro🤩
@nikoo28
@nikoo28 9 ай бұрын
Thank you, I will
@subee128
@subee128 10 ай бұрын
Thanks
@nikoo28
@nikoo28 10 ай бұрын
Welcome
@aryanbhagat9852
@aryanbhagat9852 14 күн бұрын
The code given in the video is failed on the Testcase : [1,2] So I modified the profit updation part a little please do check once. class Solution { public int maxProfit(int[] prices) { int buy_price = prices[0]; int profit = 0 ; for(int i=1 ; i < prices.length ; i++){ if(prices[i] < buy_price){ buy_price = prices[i]; } else if (prices[i] - buy_price > profit){ profit = prices[i] - buy_price ; } } return profit ; } }
@asifkhanak7792
@asifkhanak7792 11 ай бұрын
what is the name of this algorithm?
@nikoo28
@nikoo28 11 ай бұрын
Kadane's algorithm
@adityathakur9714
@adityathakur9714 11 ай бұрын
Sir please write code also at the last by yourself
@nikoo28
@nikoo28 11 ай бұрын
I want to focus on the problem solving part rather than the code part. Once the algorithm is clear to you...writing the code in any language isn't hard at all. Every good company you interview for...they will only be interested to judge if you are able to think logically. Plus, I also provide a production level code at the end with a dry run, full code and test cases on Github as well. So my question to you is, did you face any problems while understanding how to solve?
@adityathakur9714
@adityathakur9714 11 ай бұрын
@@nikoo28 No bhaiyaa the thing is I just started coding I understand the logic very well with your explanation but I'm not able to write in a limited time and bhaiya you explain so well that I understand the logic easily.
@nikoo28
@nikoo28 11 ай бұрын
If you have just started your coding journey…all the more reason to try and write the code yourself…follow the logic and debug along the way. Pause and take your time. No rush to just complete the number of problems.
@adityathakur9714
@adityathakur9714 11 ай бұрын
@@nikoo28 okk bhaiya i will give my best
@raah1634
@raah1634 8 ай бұрын
@rajnishsingh2864
@rajnishsingh2864 2 жыл бұрын
👍
@venkatesh3833
@venkatesh3833 Ай бұрын
It's more difficult to understand why your videos are getting low views than to understand the problem 😂
@riyarai9226
@riyarai9226 5 ай бұрын
Thank you so much sir, this explanation was super helpful.
@InfernoisLive-i7
@InfernoisLive-i7 Ай бұрын
Thanks
Best Time to Buy and Sell Stock III | Leetcode #123
35:40
Techdose
Рет қаралды 71 М.
Миллионер | 3 - серия
36:09
Million Show
Рет қаралды 2 МЛН
ТВОИ РОДИТЕЛИ И ЧЕЛОВЕК ПАУК 😂#shorts
00:59
BATEK_OFFICIAL
Рет қаралды 6 МЛН
Turn Off the Vacum And Sit Back and Laugh 🤣
00:34
SKITSFUL
Рет қаралды 2,8 МЛН
DP 35. Best Time to Buy and Sell Stock | DP on Stocks 🔥
9:11
take U forward
Рет қаралды 410 М.
CppCon 2014: Mike Acton "Data-Oriented Design and C++"
1:27:46
Premature Optimization
12:39
CodeAesthetic
Рет қаралды 834 М.
Machine Learning for Everybody - Full Course
3:53:53
freeCodeCamp.org
Рет қаралды 8 МЛН
Kubernetes 101 workshop - complete hands-on
3:56:03
Kubesimplify
Рет қаралды 1,7 МЛН