{"id":"kmp-empty-needle-returns-zero","text":"When `needle` is empty, `strStr` returns 0 without special-case code — a natural consequence of `j == m` when both are 0.","truth_value":"IN","source":"entries/2026/06/06/find-the-index-of-the-first-occurrence-in-a-string-solution.md","source_url":"","source_hash":"","justifications":[],"dependents":[],"metadata":{},"created_at":"","updated_at":"","reviewed_at":"","verified_at":"","retracted_at":"","explanation":{"steps":[{"node":"kmp-empty-needle-returns-zero","truth_value":"IN","reason":"premise"}]}}