Find Largest Sum Contiguous Subarray

Problem Overview

  • Find the largest sum of any contiguous subarray from a list of integers (positive and negative).
  • Input: first line N, second line N space-separated integers; Output: one integer, the maximum contiguous sum.
  • Constraints: none specified; expect mixed signs and standard integer ranges.
  • Real-world use: identify best-performing streaks in time-series or performance analytics.
  • A Cisco coding interview problem and common interview question.

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Input Variables
Execution Result: