You are given a list of text events liveInputStream, where each event is either a query or a log:
- A query is formatted as
"Q: <query_phrase>". - A log is formatted as
"L: <log_message>".
Process the events in the given order.
Ask AI Assistant

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