What should the dry run track?

Practice this question from Subarray Sum Equals K - Prefix Sum Hashmap Pattern Practice Quiz, with options and an explanation.

Question

What should the dry run track?

Option A — Correct answer

Track running sum, needed prefix, frequency map, and answer.

Option B

Only the final output, not counts or lookups

Option C

The alphabetical order of keys

Option D

Only whether values are positive

Explanation

Track running sum, needed prefix, frequency map, and answer.

Subarray Sum Equals K - Prefix Sum Hashmap Pattern Practice Quiz

All questions · Previous question · Next question

Open on QuizMaker