0

Given any K and an array of length $N$ what is the most efficient way to find the number of unique subarrays that satisfy this constraint? I believe there is an $O(N)$ solution using monotonic queues but am unsure of the specifics. Unique refers to the range of the original array that the subarray covers.

Jack Pan
  • 1,704

0 Answers0