Search
⌘K

Leetcode 1546. Maximum Number of Non-Overlapping Subarrays With Sum Equals Target

Given an array nums and a target, find the maximum number of non-overlapping contiguous subarrays whose sums equal target. The core challenge is detecting subarray sums efficiently (via prefix sums) while choosing disjoint segments greedily or with DP to maximize the count under the non-overlap constraint.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.