Skip to main content

40 docs tagged with "Sliding Window"

View all tags

Contains Duplicate II(LeetCode)

Given an integer array nums and an integer k, return true if there are two distinct indices i and j in the array such that nums[i] == nums[j] and abs(i - j) <= k.

Minimum Window Substring(LeetCode)

Given two strings s and t of lengths m and n respectively, return the minimum window substring of s such that every character in t (including duplicates) is included in the window. If there is no such substring, return the empty string "".