In this exercise, you'll build a system to assign conversations to customer support agents.
Implement an AssignmentSystem class that has the following API:
set_limit(agent_name, limit)
assign(conversation_id)
preview_assignments(count)
agents = ["Alice", "Bob", "Charlie"]
system = AssignmentSystem(agents)
system.set_limit("Bob", 4)
system.set_limit("Charlie", 3)
I want to know who will receive next 4 conversations
system.preview_assignments(4)
Output: ["Alice", "Bob", "Charlie", "Alice"]
Make some assignments
system.assign(101) # Assigns to Alice
system.assign(102) # Assigns to Bob
system.assign(103) # Assigns to Charlie
system.assign(104) # Assigns to Alice
I want to know who will receive next 5 conversations
system.preview_assignments(5)
['Bob', 'Charlie', 'Bob', 'Charlie', 'Bob']