Inverted Index with Phrase Search

Given a list of documents (each document is a whitespace-separated text), build an inverted index and support search.

Input

  • documents: List<String> (document id is its index in the list)
  • `p...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: