Problem Submissions Solution

Maximize Number of 1's

Difficulty: Medium

Acceptance: %

Points: 30.00

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:
Amazon Microsoft
Topics:
Array Binary Search
Locked Content
Access Restricted: Please Login to access the code editor and test cases.