Sliding Window Questions

Easy Level:

Maximum Average Subarray I
Problem: Given an array, find the contiguous subarray of given length k that has the maximum average.
Longest Substring Without Repeating Characters
Problem: Find the length of the longest substring wi…


This content originally appeared on DEV Community and was authored by Shashank Trivedi

Easy Level:

  1. Maximum Average Subarray I
    Problem: Given an array, find the contiguous subarray of given length k that has the maximum average.

  2. Longest Substring Without Repeating Characters
    Problem: Find the length of the longest substring without repeating characters.

  3. Minimum Size Subarray Sum
    Problem: Find the minimal length of a contiguous subarray of which the sum is greater than or equal to a given target.

  4. Find All Anagrams in a String
    Problem: Given two strings, find all start indices of the first string's anagrams in the second string.

Medium Level:

  1. Longest Substring with At Most Two Distinct Characters
    Problem: Find the length of the longest substring that contains at most two distinct characters.

  2. Permutation in String
    Problem: Given two strings, check if one string is a permutation of the other within a sliding window of the second string.

  3. Longest Repeating Character Replacement
    Problem: Find the length of the longest substring that can be turned into the same character by replacing at most k characters.

  4. Subarrays with K Different Integers
    Problem: Find the number of subarrays with exactly k distinct integers.

  5. Grumpy Bookstore Owner
    Problem: Maximize the number of satisfied customers by applying a "non-grumpy" behavior on a contiguous window of customers.

  6. Sliding Window Maximum
    Problem: Given an array, find the maximum value in every sliding window of size k.

Hard Level:

  1. Minimum Window Substring
    Problem: Given two strings, find the minimum window in the first string that contains all characters of the second string.

  2. Longest Substring with At Most K Distinct Characters
    Problem: Find the length of the longest substring that contains at most k distinct characters.

  3. Shortest Subarray with Sum at Least K
    Problem: Find the shortest subarray with a sum of at least k.

  4. Subarray Product Less Than K
    Problem: Find the number of contiguous subarrays where the product of all elements is less than k.

  5. Count Number of Nice Subarrays
    Problem: Find the number of subarrays that contain exactly k odd numbers.


This content originally appeared on DEV Community and was authored by Shashank Trivedi


Print Share Comment Cite Upload Translate Updates
APA

Shashank Trivedi | Sciencx (2024-10-04T18:45:21+00:00) Sliding Window Questions. Retrieved from https://www.scien.cx/2024/10/04/sliding-window-questions/

MLA
" » Sliding Window Questions." Shashank Trivedi | Sciencx - Friday October 4, 2024, https://www.scien.cx/2024/10/04/sliding-window-questions/
HARVARD
Shashank Trivedi | Sciencx Friday October 4, 2024 » Sliding Window Questions., viewed ,<https://www.scien.cx/2024/10/04/sliding-window-questions/>
VANCOUVER
Shashank Trivedi | Sciencx - » Sliding Window Questions. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/10/04/sliding-window-questions/
CHICAGO
" » Sliding Window Questions." Shashank Trivedi | Sciencx - Accessed . https://www.scien.cx/2024/10/04/sliding-window-questions/
IEEE
" » Sliding Window Questions." Shashank Trivedi | Sciencx [Online]. Available: https://www.scien.cx/2024/10/04/sliding-window-questions/. [Accessed: ]
rf:citation
» Sliding Window Questions | Shashank Trivedi | Sciencx | https://www.scien.cx/2024/10/04/sliding-window-questions/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.