LC 15

3Sum

Medium · LC 1–100

arraysortingtwo-pointers
Free

Candidate solution routes

Primary

Opposite-Direction Two Pointers

Free

Invariant: Every uneliminated pair uses endpoints inside [l,r]; a moved endpoint is proven unable to pair with any remaining opposite endpoint to satisfy the goal.

candidate confidence: 0.680 · 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.