Problem 1590 · Medium

Make Sum Divisible by P

Remove the shortest proper subarray so the remaining total divides by p by tracking prefix remainders. The visual marks the remainders and the best removal window.

Open the interactive visualisation