Problem 2845 · Medium

Count of Interesting Subarrays

Track prefix counts modulo the given modulo and look up how many earlier prefixes share the needed residue.

Open the interactive visualisation