Given a binary array arr[] containing only 0s and 1s and an integer k, you are allowed to flip at most k 0s to 1s. Find the maximum number of consecutive 1's that can be obtained in the array after performing the operation at most k times.
Topics
Companies
Articles
Examples:
NA
Constraints:
1 = arr.size() = 10^5
0 = k = arr.size()
0 = arr[i] = 1
Companies:
AmazonMicrosoft
Topics:
ArrayBinary Search
Please log in to access the Submissions tab, where you can review your progress and explore code submissions from other participants.
Please log in to access the Solution tab and view detailed answers and explanations.
Please log in to access the Discussion tab and join conversations with other participants.
Access Restricted: Please Login to access the code editor and test cases.