[leetcode 1004] Max Consecutive Ones III
Given an array A of 0s and 1s, we may change up to K values from 0 to 1. Return the length of the longest (contiguous) subarray that contains only 1s. 0과 1로 구성된 배열이 있을 때 K개수 만큼 0을 1로 변경가능하다. 1로 구성된 가장 긴 배열의 길이를 찾아라. Example 1: Input: A = [1,1,1,0,0,0,1,1,1,1,0], K = 2 Output: 6 Explanation: [1,1,1,0,0,1,1,1,1,1,1] Bolded numbers were flipped from 0 to 1. The longest subarray is underlined. Examp..
2020. 9. 30.