Maximum Consecutive Ones III (If K Flip is Allowed)
Vložit
- čas přidán 7. 09. 2024
- Given an array which only consists of 0s and 1s. Write a code to find the maximum number of consecutive 1s in an array, if we can flip k zeros.
Maximum consecutive ones III java code - webrewrite.com...
Maximum consecutive ones II - • Maximum Consecutive On...
Maximum consecutive ones in an array of 0s and 1s - • Maximum Consecutive On...
For example:
Input: {1, 1, 0, 0, 0, 1, 1, 1, 1, 1}, k = 2
Output: 7
Clear and vivid explanation
Thank you
Thats great explanation thanks sir
Thanks
Good teacher
Thank you! 😃
I am a dumb dumb person. Thanks.
On point, thank you
You are so welcome
This is magic ! Wow , Thanks for making me understand
You are welcome!
super awesome solution
Thank you! Cheers!
try 1 test case:
k=1
arr=[0,1]
Output should be 1, rather than 2
Thankyou for your hardwork
Thank you
thank you !!
Thank you for your comment
Hi,
Can you please tell which editor or software are you using to write on the eclipse in the video?
I want to make a few videos.
Thanks
Hi Chetan, It's a paid tool for mac (screenbrush).
@@ProgrammingTutorials1M Thanks for the response.
Why is it end - start +1? How did you come with this expression?
It basically is the window size. It is a very common expression used in sliding window problems
Thank you
You're welcome
👌👌👌👌👌
Thank you
perfect!!
Thank you
@@ProgrammingTutorials1M can you please suggest a list of important coding questions as my placements is coming in a month...it will be a huge help...thanks in anticipation!!
In geeksforgeeks there is a list of must do coding questions, It's a good collection.
www.geeksforgeeks.org/must-do-coding-questions-for-companies-like-amazon-microsoft-adobe/
This code will break in the given use case
K = 1
Arr = {1,1,1,0,1}
The code is printing ans as 5. However the correct answer is 4
When you do the one flip the maximum consecutive ones would be 5
the code is good but he's not able to explain in a good manner so try and get better in that .
I'll try to improve.
thank you
You're welcome