슬라이딩윈도우 #투포인터2 [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. [leetcode 424] Longest Repeating Character Replacement Given a string s that consists of only uppercase English letters, you can perform at most k operations on that string. In one operation, you can choose any character of the string and change it to any other uppercase English character. Find the length of the longest sub-string containing all repeating letters you can get after performing the above operations. Note: Both the string's length and k.. 2020. 9. 30. 이전 1 다음