← ALL NOTES
Array

1590. Make Sum Divisible by P

Remove the shortest contiguous subarray (possibly empty, but not the whole array) so the remaining sum is divisible by p; return its length or −1. Let target = total % p; if 0, remove nothing.…

Loading…