Golibrary.co - Everyone for Education
Problem Statement Given an array containing 0s and 1s, if you are allowed to replace no more than ‘k’ 0s with 1s, find the Length of the longest contiguous subarray having all 1s. Example 1: Input: Array=[0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1], k=2 Output: 6 Explanation: Replace the ‘0’ at […]
The post Find length of Longest Subarray with contiguous ones after replacement appeared first on www.golibrary.co.