Gas Station 💚 Leetcode 134 Solution | Explained Hindi C++ | hello World

  Рет қаралды 11,190

Hello World

Hello World

Күн бұрын

Пікірлер: 56
@ranjitasahu19
@ranjitasahu19 2 ай бұрын
thank you so much, I understood the problem but took a while to get why in your code totalDiff
@abhishekverma7604
@abhishekverma7604 8 ай бұрын
class Solution { public: int canCompleteCircuit(vector& gas, vector& cost) { int gs = gas.size(); int cs = cost.size(); int gasSum = 0; int costSum = 0; int start = 0; int currGas = 0; for(int i = 0;i
@honeybansal9165
@honeybansal9165 Ай бұрын
bro ek point ko baar baar mt repeat kra kro.. sunne wala pagal hojata h.
@user-hf4ck1lg5s
@user-hf4ck1lg5s Ай бұрын
till intuition part its good but after that not good.
@akanshabhardwaj5055
@akanshabhardwaj5055 25 күн бұрын
nyc explaination
@MaheshGautam-y8i
@MaheshGautam-y8i 10 ай бұрын
key = agar answer hota to wo pura traverse kar jata
@HelloWorldbyprince
@HelloWorldbyprince 9 ай бұрын
yup
@gurjotsingh3726
@gurjotsingh3726 Жыл бұрын
very underrated brother, great explanation, made it look easy
@sujalchandrakar3874
@sujalchandrakar3874 3 ай бұрын
doubt :- suppose there are 5 indices and we have succesfully eliminated first 3 indices, it means answer will be now either 4th index or 5th index. Now if start calculating fuel from 4th index and it remains positive after traversing whole array , ans we return 4th index as answer . but there is chance na that when it goes into loop after 5th index (which we didnt check in code) it goes -ve at any index before 4th ... in that case answer will become 5th index na ...but code will return 4th index
@PeterParker-i6g
@PeterParker-i6g 2 ай бұрын
i did it with brute force but always time limit exceeding at 38 th test case. can it be done with brute force or must be done with an optimal
@rishav144
@rishav144 Жыл бұрын
great explanation ...pls continue with leetcode questions
@HelloWorldbyprince
@HelloWorldbyprince Жыл бұрын
Thank you, I will
@smitj5404
@smitj5404 7 ай бұрын
kyaa baat hai sir :) bohot badhiyaa, intuition achhe se samjhaya, thanks a lot !!!
@HelloWorldbyprince
@HelloWorldbyprince 7 ай бұрын
Thanks a lot keep sharing my channel
@sksadiruddin4191
@sksadiruddin4191 3 ай бұрын
bohut maza aya awasome solutionnnn
@sakshamshrivastava3482
@sakshamshrivastava3482 11 ай бұрын
can we solve it using queue or stack? and if not .. why?
@VedanshandStavyaSaxena
@VedanshandStavyaSaxena 7 ай бұрын
great vid
@HelloWorldbyprince
@HelloWorldbyprince 7 ай бұрын
Thanks a lot keep sharing my channel
@jeetdesaimusic
@jeetdesaimusic 7 ай бұрын
Thank you very much bhai,great explanation🙏🙏
@HelloWorldbyprince
@HelloWorldbyprince 7 ай бұрын
Always welcome
@pranavpranjal2717
@pranavpranjal2717 4 ай бұрын
nice explanation brother
@pragynasmitasahoo7443
@pragynasmitasahoo7443 4 ай бұрын
great explanation!
@akshanshsharma6025
@akshanshsharma6025 8 ай бұрын
you are gem bro i solved it by myself just watch first 6 minutes and its done
@HelloWorldbyprince
@HelloWorldbyprince 8 ай бұрын
Thanks Please share this channel with your friends
@Curiousss_Shivammm
@Curiousss_Shivammm 4 ай бұрын
I knew the condition that we can skip those whose cost is less than gas but still there can be a scenario where 2 starting point both give positive difference in starting but in one it travels completely while in other in some station it couldn't go further and hence not the answer . For this conditon shouldn't your code break you are only judging by starting gas difference
@omrasal5014
@omrasal5014 3 ай бұрын
i have one question , the array is not circular ....then how its working
@Curiousss_Shivammm
@Curiousss_Shivammm 3 ай бұрын
​@@omrasal5014 I used module n for it
@tahmiszubair1644
@tahmiszubair1644 4 ай бұрын
nice explanation
@guru8035
@guru8035 5 ай бұрын
Great explanation
@shivangisrivastava1158
@shivangisrivastava1158 7 ай бұрын
Amazing , very useful thought process!
@HelloWorldbyprince
@HelloWorldbyprince 7 ай бұрын
Glad you think so!
@SushantKumarGond
@SushantKumarGond 2 ай бұрын
Thank you
@harshitaajaria8
@harshitaajaria8 3 ай бұрын
awesome bhaiya💗👌
@soumyamondal
@soumyamondal Жыл бұрын
Prince Bhaiya make videos on Greedy Algorithm.
@HelloWorldbyprince
@HelloWorldbyprince Жыл бұрын
Sure 👍
@csithub
@csithub Жыл бұрын
Very nice explanations big bro
@HelloWorldbyprince
@HelloWorldbyprince Жыл бұрын
Thanks yaar ❤️ please share and support my channel
@codeforcesaccount
@codeforcesaccount Жыл бұрын
great video
@HelloWorldbyprince
@HelloWorldbyprince Жыл бұрын
Glad you enjoyed it
@upendrakumarjha9245
@upendrakumarjha9245 8 ай бұрын
Mjaa aagya bhaia 😊🎉
@vikrant3011
@vikrant3011 Жыл бұрын
Bhaiya you are doing great job
@ayushchauhan7604
@ayushchauhan7604 Жыл бұрын
amazing brother
@TrishaDas-if2pz
@TrishaDas-if2pz 6 ай бұрын
@iamsanyam8
@iamsanyam8 10 ай бұрын
bhaiya great method of teaching
@HelloWorldbyprince
@HelloWorldbyprince 9 ай бұрын
Thanks for your support, Please share my channel
@iamnoob7593
@iamnoob7593 Жыл бұрын
great explanation
@wanderbite7
@wanderbite7 7 ай бұрын
Great explanation thanks
@HelloWorldbyprince
@HelloWorldbyprince 7 ай бұрын
You're welcome!
@Soneone-kz4fp
@Soneone-kz4fp Жыл бұрын
Understood!
@naikajsevak6090
@naikajsevak6090 Жыл бұрын
great explanation bro as expected thank you
@HelloWorldbyprince
@HelloWorldbyprince Жыл бұрын
Welcome 👍
@animeshanandcool
@animeshanandcool 11 ай бұрын
thanKyou
@HelloWorldbyprince
@HelloWorldbyprince 10 ай бұрын
your welcome
@ayushkumar-xw5kv
@ayushkumar-xw5kv Жыл бұрын
Nhi aaya
@HelloWorldbyprince
@HelloWorldbyprince Жыл бұрын
why?
L5. Jump Game - II | Greedy Algorithm Playlist
16:45
take U forward
Рет қаралды 52 М.
БЕЛКА СЬЕЛА КОТЕНКА?#cat
00:13
Лайки Like
Рет қаралды 2,8 МЛН
pumpkins #shorts
00:39
Mr DegrEE
Рет қаралды 50 МЛН
Inside Out 2: ENVY & DISGUST STOLE JOY's DRINKS!!
00:32
AnythingAlexia
Рет қаралды 13 МЛН
LeetCode was HARD until I Learned these 15 Patterns
13:00
Ashish Pratap Singh
Рет қаралды 386 М.
134. Gas Station || Leetcode || C++ || Hindi
10:02
Code with Sky
Рет қаралды 2,9 М.
Gas Station - Greedy - Leetcode 134 - Python
15:47
NeetCode
Рет қаралды 132 М.
БЕЛКА СЬЕЛА КОТЕНКА?#cat
00:13
Лайки Like
Рет қаралды 2,8 МЛН