Daily challenge for 2026-11-07
676. Divisible Adjustment Periods
You are given an array of integers adjustments representing a work log of signed integer adjustments, and a positive integer base. Return the number of contiguous subarrays (periods) of length at least two whose sum is divisible by base.
Constraints:
There are 0–2,000 integer adjustments, each with absolute value at most 1,000,000. The base is a positive integer at most 1,000,000. Only contiguous periods of length at least two count. Zero sums and negative sums can be divisible by the base.
Example:
Input: adjustments = [4, 5, 0, -2, -3, 1], base = 5
Output: 5
Run this challenge interactively in Python or JavaScript when the app loads.