{"id":"early-exit-on-overshoot","text":"The length check `len(prefix) > len(s)` guarantees the prefix-building loop terminates as soon as the accumulated string exceeds the target, bounding runtime to O(len(s))","truth_value":"IN","source":"entries/2026/06/06/check-if-string-is-a-prefix-of-array-solution.md","source_url":"","source_hash":"","justifications":[],"dependents":[],"metadata":{},"created_at":"","updated_at":"","reviewed_at":"","verified_at":"","retracted_at":"","explanation":{"steps":[{"node":"early-exit-on-overshoot","truth_value":"IN","reason":"premise"}]}}