Back to Browse

CSES 3221 | Sliding Window Minimum — Full Solution Explained

25 views
Mar 1, 2026
15:12

In this video, I walk through a full solution to the Sliding Window Minimum problem from the CSES Problem Set. This is a classic problem that requires a smart data structure to avoid brute-force — we need to find the minimum of every window of size k efficiently using a Monotonic Deque. 📌 Problem Summary: Given an array of n integers and a window of size k, find the minimum element in each sliding window and output the XOR of all those minimums. The array is generated using a linear congruential generator (LCG) — no direct input Output is the XOR of all window minimums Brute force is too slow — we need O(n) solution 🔗 Problem Link: https://cses.fi/problemset/task/3221/

Download

0 formats

No download links available.

CSES 3221 | Sliding Window Minimum — Full Solution Explained | NatokHD