LeetCode Maximum Average Subarray I Given an array consisting of n integers, find the contiguous subarray of given length k that has the maximum average value. And you need to output the maximum average value. Example 1: Input: , k = 4 Output:... Read More
Tag Archives: 滑动窗口
LeetCode Contains Duplicate III
LeetCode Contains Duplicate III Given an array of integers, find out whether there are two distinct indices i and j in the array such that the absolute difference between nums and nums is at most t and the absolute difference... Read More
LeetCode Longest Repeating Character Replacement
LeetCode Longest Repeating Character Replacement Given a string that consists of only uppercase English letters, you can replace any letter in the string with another letter at most k times. Find the length of a longest substring containing all... Read More
LeetCode Permutation in String
LeetCode Permutation in String Given two strings s1 and s2, write a function to return true if s2 contains the permutation of s1. In other words, one of the first string's permutations is the substring of the second string. Example 1: Input:s1 = "ab"... Read More
LeetCode Contains Duplicate II
LeetCode Contains Duplicate II Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums = numsand the difference between i and j is at most k. 本题是LeetCode Contains... Read More