You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Pattern Used: Linear Traversal / Accumulator Pattern
* Why this pattern: Summing elements only requires a single pass while accumulating a running total, with no need for extra data structures or multiple passes.
*
* Interview Scenario:
* "Asked as a warm-up question in almost every SDE-1 phone screen: 'Given an array of daily expenses, write a function to compute the total spend.' Interviewers use it to check basic loop/array fluency before moving to harder patterns."