One room (Real-time Chat)

A chat server relays messages. Everyone is in one room, general. join <user prints <user joined general plus (with <others) (sorted, comma separated) if anyone is already there; joining twice prints error: <user already in general. say <user <text prints [general] <user: <text - <recipients (everyone else, sorted) or (nobody else here); a user not in the room prints error: <user is not in general. leave <user prints <user left general.

Input: One command per line.

Output: One line per command.

Difficulty: Easy. Write your answer in the browser editor, run the examples, then submit it against hidden tests. Python and JavaScript are free; other languages are part of licode Club.

Hint

  • A set of users per room.

More Real-time Chat practice