LeetCode 523 Continuous Subarray Sum - Problem Statement

The problem

Given an integer array nums and an integer k, return true if there's a subarray of length at least 2 whose sum is a multiple of k.

With nums = [23, 2, 4, 6, 7] and k = 6, the answer is true. The subarray [2, 4] sums to 6, which is a multiple of 6.

This combines prefix sums with modular arithmetic. How can remainders help you find subarrays divisible by k?

Constraints: 1n1051 \le n \le 10^5, values from 00 to 10910^9, k1k \ge 1.