All Problems

Continuous Subarray Sum

MediumarrayExpected: O(n) time, O(n) spaceInterview Context
hash-mapprefix-sum

Problem

Given an integer array and an integer k, return true if the array has a continuous subarray of size at least two whose elements sum up to a multiple of k.

Loading...