Panda Guru LogoPanda
Guru

Sliding Window TOP Questions that must be solved

Round 1

Questions:

  1. 1004. Max Consecutive Ones III
    Find the longest sequence of 1s by flipping at most k zeros.

  2. 424. Longest Repeating Character Replacement
    Replace at most k characters to get the longest repeating substring.


Round 2

Questions: 3. 1423. Maximum Points You Can Obtain from Cards
Pick cards from either end to maximize the sum. (Left-right scanner approach)

  1. 992. Subarrays with K Different Integers
    Find the number of subarrays with exactly K different integers.

  2. 1248. Count Number of Nice Subarrays
    Count subarrays with exactly K odd numbers.

  3. 2962. Count Subarrays Where Max Element Appears at Least K Times
    Count the number of subarrays where the maximum element appears at least K times.


Round 3

Questions: 7. 1358. Number of Substrings Containing All Three Characters
Count substrings containing at least one 'a', 'b', and 'c'.


Round 4

Questions: 8. 523. Continuous Subarray Sum
Find if a subarray sum is a multiple of k.

  1. 2302. Count Subarrays With Score Less Than K
    Count subarrays whose sum multiplied by their length is less than K.

  2. 2461. Maximum Sum of Distinct Subarrays With Length K
    Find the max sum of K distinct elements in a subarray.