Given a list of documents, each with a unique document ID and associated text. Implement a system that allows efficient searching of phrases within these documents. The search is case-insensitive and the system should be capable of handling searching over one million documents.
Implement the DocumentLibrary class:
DocumentLibrary(List<List<String>> documents)Initialize a document library with a list of document IDs and text.List<String> search(String phrase)Find all document IDs that contain the phrase (case-insensitive).
Ask AI Assistant

Ask AI Assistant
Ask me anything about this coding question!
Test Cases
Input
Output
Expected