pyPython Practice LabFrom first print to final round
PYTHON PROBLEM 278 · Company Medium

Count subarrays with target sum: Include negative values

Use prefix counts where a sliding window would fail because values may be negative.

Move boundaries while preserving a window or two-pointer invariantprefix sumhash mapcompany screen
PROBLEM OVERVIEW

What this Python exercise asks you to practise

This scenario tests count subarrays with target sum. It belongs to the Top Company Arrays, Strings, and Sliding Windows roadmap and uses the move boundaries while preserving a window or two-pointer invariant pattern.

Company-screen array and string patterns: two pointers, matrices, prefix sums, and sliding windows.

COMPLETE WORKSPACE

Learn the plan, trace the logic and run the solution

Complete access unlocks the full statement, input and output examples, visual execution plan, hints, browser compiler, solution and line-by-line interpretation.

Unlock all 360 problems · ₹599One full year · one payment · no automatic renewal
INTERVIEW CONTEXT

Skills and reported company tags

Interview platforms and learner reports associate this problem family with the companies below. Tags are preparation signals, not a guarantee that an identical question will appear.

AmazonMetaGoogleMicrosoft