Available question text
Count the number of subarray sums within [lower, upper] — equivalently, count pairs of prefix sums whose difference lies in [lower, upper]. With n up to 1e5 this requires better than O(n^2), typically solved using prefix sums plus a divide-and-conquer (merge sort) or a BIT/ordered set with coordinate compression.
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 327. Count of Range Sum
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source