Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Find length of longest subarray with contiguous ones after replacement

Find Length Of Longest Subarray With Contiguous Ones After Replacement

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.



This post first appeared on Everyone For Education, please read the originial post: here

Share the post

Find length of longest subarray with contiguous ones after replacement

×

Subscribe to Everyone For Education

Get updates delivered right to your inbox!

Thank you for your subscription

×