Tag: sliding window algorithm
Teaching Kids Programming: Videos on Data Structures and Algorithms Given a string s and an integer k, return the number of k-length substrings that occur more than once in …
Teaching Kids Programming: Videos on Data Structures and Algorithms Given a string s, find the length of the longest substring that contains at most 2 distinct characters. Constraints n …
Given a list of integers nums, return the length of the longest contiguous sublist where all its elements are distinct. Constraints n ≤ 100,000 where n is the length …
Given a list of integers nums and an integer k, return a list of count of distinct numbers in each window of size k. Constraints 1 ≤ k ≤ …
Given a string s and an integer k, return the number of k-length substrings that occur more than once in s. Constraints n ≤ 100,000 where n is the …