Text Search: search a word, then search a phrase (follow-up)

Asked at Confluent · Coding Questions · Difficulty: Medium · Last asked Jul 19, 2026

Index a multi-line text once, then answer many queries that count either a single word or a contiguous multi-word phrase, case-insensitively.

Loading the problem…