LC 53

Maximum Subarray

Medium · LC 1–100

arraydivide-and-conquerdynamic-programming
Free

Candidate solution routes

Primary

Divide, recurse, and combine

Free

Invariant: solve(lo,hi) returns a complete summary conforming to its domain contract; combine depends only on child summaries and accounts for every cross-domain contribution exactly once.

candidate confidence: 0.527 · metadata_only

Alternate 1

Linear dynamic programming

Free

Invariant: After processing i, every state through i equals the true value under its definition, and every future transition reads only these finalized states.

candidate confidence: 0.470 · metadata_only

How to use this page

Read the statement and constraints first, then validate recognition signals, invariant, and complexity. Candidate score is not correctness evidence.