Do leave a comment if you get the solution :) helps me a lot C++ Code link: github.com/striver79/SDESheet/blob/main/consecutiveOnesCpp Java Code link: github.com/striver79/SDESheet/blob/main/consecutiveOnesJava Instagram: striver_79 Join our telegram group: t.me/Competitive_Programming_tuf
i thought of same logic, but was scared to code it. watched ur video till 2min 53s and got confidence to try coding it myself and i can tell i feel good. Still beginner in dsa! Thank you TUF!
I had solved this question already in leetcode but still saw your video because I just like to watch your videos even if I know the video content already.
I have performed the exactly same code on leetcode without even watching solution. Runtime: 84 ms, faster than 36.73% of C++ online submissions for Max Consecutive Ones. But why 36.73 ? I don't think this could be optimized to O(1) or O(log n)
for the same code when i run multiple times it gave different runtime..dont even bother about it...it depends on processor speed, internet speed, server speed. Time Complexity and Space Complexity are important
This problem is pretty easy as compared to other problems of this day and even before this day, and it doesn't even use 2 pointer approach, so why categorize this in this category.
after watching 3 minutes of the video i tried again and it took 10 minutes to solve this problem. my code is different. kia is terha ap ka concept copy krny sy mery skills develop hongy ?
Do leave a comment if you get the solution :) helps me a lot
C++ Code link: github.com/striver79/SDESheet/blob/main/consecutiveOnesCpp
Java Code link: github.com/striver79/SDESheet/blob/main/consecutiveOnesJava
Instagram: striver_79
Join our telegram group: t.me/Competitive_Programming_tuf
I solved 400+ problems on leetcode but still watching this easy one problem because of you striver.. ✌
by replacing K 0's karle fir
i thought of same logic, but was scared to code it. watched ur video till 2min 53s and got confidence to try coding it myself and i can tell i feel good. Still beginner in dsa! Thank you TUF!
I had solved this question already in leetcode but still saw your video because I just like to watch your videos even if I know the video content already.
That is known as TIME WASTE
Your explanation is way smoother that any one can imagine 💥💥🙏💯💥
A wonderful and simple explanation. Thanks man!
This series is too good 🙌🙂
Thank you bhya, for making videos for us, we all love you 💓💓💯💯💯
Bhai. You are a Farishta for a Tier 3 Student. I started loving DSA just because of you.
Nice explanation your videos are really good...please keep on making such videos.
Thank You So Much Striver Brother.............🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻
This is an easy one ✌
UNDERSTOOD...!!!
Thanks striver for the video... :)
Keep up the amazing work man 👍👍 .
Understood😎😎
great bhiya , love your series of DSA
Amazing! Loved the explaination
Thank you Striver Bhaiya!!
ok so, shouldn t you put another maxi = max (maxi, cnt); before cnt = 0;? or otherwise you will lose the count at the first number that s not 1?
No because maxi is updated at every step so definitely it would have been saved in last step.
@@aanchalmittal9897 how maxi is updated i am not getting it...i am newby
Great tutorial, helped a lot! Thank You!
You ae the bestest ♥️♥️♥️♥️
it is a dynamic programming question.
Thank you 🤗
Nice explain plz upload more vedio
I have performed the exactly same code on leetcode without even watching solution. Runtime: 84 ms, faster than 36.73% of C++ online submissions for Max Consecutive Ones. But why 36.73 ? I don't think this could be optimized to O(1) or O(log n)
Ignore that, it cannot be better than that. So chill out. Don’t focus on that focus on the tc and sc
@@takeUforward ok bhaiya! thanks for clearing doubt :)
for the same code when i run multiple times it gave different runtime..dont even bother about it...it depends on processor speed, internet speed, server speed. Time Complexity and Space Complexity are important
I copied line by line the code you wrote .! Still its showing runtime error .. Can you please explain why this is happening
The gfg link in DSA sheet is not the exact problem. Please have a look sir and please upload a solution for that problem
thanks
Thankyou
to the expectation!!
I did it by two pointer, same thing however
7️⃣✅
Understood
#Understood
This problem is pretty easy as compared to other problems of this day and even before this day, and it doesn't even use 2 pointer approach, so why categorize this in this category.
Kaise ho bhaiya?
nice :)
I am able to figure out the logic of such questions but unable to write the code structure being a beginnner. anyone else facing this problem
yes me too? have u figured out this problem?
2nd view❤️❤️
How it is two pointer
The problem is very similar to max subarray... actually as I started watching I remembered there's a question similar to kadane's algo
I thought he'd use bit manipulation
i spent 90 minutes but could not solve this problem. i am really worried.
after watching 3 minutes of the video i tried again and it took 10 minutes to solve this problem. my code is different. kia is terha ap ka concept copy krny sy mery skills develop hongy ?
only difference in code is i used ternary operator instead of Math.max . which one is fast and consume less space ?
@@JohnDoe-ej6vm haan bhai hongi skills develop, starting me time lagta h, 15 - 20 min bahut hote h thinking ke liye uske baad dekh lia kro solutions
@@JohnDoe-ej6vm har topic ke starting ke 15-20 questions ke soltuion dekh kar skte ho