LC 30

Substring with Concatenation of All Words

Hard · LC 1–100

hash-tablesliding-windowstring
Free

Candidate solution routes

Primary

Variable-Size Sliding Window

Free

Invariant: left and right never retreat; whenever a result is recorded, the maintained state exactly matches [left,right] and satisfies the variant's validity or minimality condition.

candidate confidence: 0.510 · metadata_only

Alternate 1

Fixed-Size Sliding Window

Free

Invariant: After processing right endpoint r, the summary exactly describes the most recent at most k items; a result is recorded only at length k.

candidate confidence: 0.440 · metadata_only

Alternate 2

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.