LC 41

First Missing Positive

Hard · LC 1–100

arrayhash-table
Free

Candidate solution routes

Primary

Binary-Search Boundary / First True

Free

Invariant: The first True always lies in [lo,hi]; indexes left of lo are proven False, while hi remains a feasible candidate.

candidate confidence: 0.418 · metadata_only

Alternate 1

Prefix State plus Hash Frequency

Free

Invariant: Before processing position i, the table contains exactly the historical prefixes allowed as left boundaries; query-before-insert avoids using a future or self state accidentally.

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