Problem 974 · Medium

Subarray Sums Divisible by K

Count contiguous subarrays whose sum is a multiple of k. The visual groups prefix sums by remainder and counts matching buckets.

Open the interactive visualisation