NewThe Learning module is now liveSee what's new

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.

Test Cases
Input
Output
Expected