Problem 2261 · Medium

K Divisible Elements Subarrays

Extend each start index until it holds more than k multiples of p, and count the distinct value sequences seen along the way.

Open the interactive visualisation