Thanks dude. I have solved problems way harder than this in the past but haven't done many algorithmic problems as of late and was getting frustrated why some cases weren't passing when the solution was so obvious (if you are somewhat experienced). My issue was that I was not checking if i + 2 < len(c) before checking if c[i + 2] == 0. Seems so obvious now but was huge pain when I wasn't getting it. Anyway thanks for the explanation.
len_of_clouds = 7 which means last index = 6 so when i=6, (i+2) it would be (6+2 = 8) and 8 is out of range. So in case of i < len(c), "i" would reach to 6, so to avoid that you should minus 1 to len(c), which make loop iterate till i = 5. hope that makes sense! 😅
thank you bro, i hv a suggestion for your channel to grow i saw a channel named JAVAID he is getting lots of views in same questions which you have done in your channel what he is doing is , in every discussion section of every question he had given his link of particular video and had written few words about that question thts all.. I suggest u also do the same and look how your views will increase coz u deserve more views thank u p.s- channel name is JAVAAID-Coding Interview Preparation
Thank you so much sir ❤❤❤❤❤❤❤❤❤❤
Glad it helped😊. Please do share with your friends too😊
The most underrated solution. I searched here and there but didn't find such explanation. Unmatchable. Thanks @coding cart.
Glad you liked it 😊.
Do share with your friends too 🙂
I learned from this exercise the order of the if conditions matters. Placing c[i+2] first results in out of range since it is evaluated before n+2
Excellent!
Thank you bro...
Welcome
Do in Java
Thanks dude. I have solved problems way harder than this in the past but haven't done many algorithmic problems as of late and was getting frustrated why some cases weren't passing when the solution was so obvious (if you are somewhat experienced). My issue was that I was not checking if i + 2 < len(c) before checking if c[i + 2] == 0. Seems so obvious now but was huge pain when I wasn't getting it. Anyway thanks for the explanation.
Always try to check boundaries cases😊
sir what is your networth and which company are you currently working??
Waw👌
Thanks:)
why while i < len(c) -1:? y don't while i < len(c) :?
Just give a try from your end...you will get it :)
It will give you out of range error
len_of_clouds = 7
which means last index = 6
so when i=6, (i+2) it would be (6+2 = 8) and 8 is out of range. So in case of i < len(c), "i" would reach to 6, so to avoid that you should minus 1 to len(c), which make loop iterate till i = 5. hope that makes sense! 😅
@@rudeadyet1992 thanks for ur explanation. I was noob at that time😂
@@sumanthchowdary9699 no worries :)
thank you bro,
i hv a suggestion for your channel to grow
i saw a channel named JAVAID he is getting lots of views in same questions which you have done in your channel
what he is doing is , in every discussion section of every question he had given his link of particular video and had written few words about that question thts all.. I suggest u also do the same and look how your views will increase
coz u deserve more views
thank u
p.s- channel name is JAVAAID-Coding Interview Preparation
Okay, Thank you for your suggestions. We will keep in mind. Thanks again for you support
@@codingcart always welcome bro
c = [0, 1, 1, 0, 0, 0, 1, 0, 0] or c = [0, 1, 1, 1, 0, 0, 0, 1, 0, 0]
Why wouldn't a counter with a for loop not work here?
did anyone
try continuous 2 thunderhead in this code.
Thank you for the video! A final question. I don't get why to put "while i