← 返回 coinbase 的题目列表Order Event Processing with Kafka
类型:online_judge
Given a stream of orders transmitted via Kafka, each order can have three states: new, fill, and cancel. Write a function to process these orders and return a mapping table of the final state of each order. Consider idempotency, where duplicate data does not affect the output. Input format: [number of states, 'order1 status', 'order2 status', ...], Example Input: [3, 'order1 new', 'order1 fill', 'order2 cancel']. Output format: {'order1': 'fill', 'order2': 'cancel'}.
Example
Input
3
order1 new
order1 fill
order2 cancel