Problem 2799 · Medium

Count Complete Subarrays in an Array

Find the shortest window from each start that holds every distinct value, then count all longer ends.

Open the interactive visualisation