
Given a list of notification events for a mobile app, return the unread badge count after processing all events. Each event is a list where the first value is the event type: "receive", "read", or "clear". A receive event adds a notification with a unique integer id, a read event marks that id as read if it exists and is unread, and a clear event removes all unread notifications. Return the final unread count as an integer.
Input: events = [["receive", 101], ["receive", 102], ["read", 101]]
Output: 1
Explanation: Notification 101 is read, so only 102 remains unread.
Input: events = [["receive", 5], ["receive", 6], ["clear"], ["receive", 7]]
Output: 1
Explanation: `clear` removes all unread notifications, then notification 7 is added.
1 <= len(events) <= 10^5receive and read, event format is [type, id] where 0 <= id <= 10^9clear, event format is ["clear"]receive eventsevents = [["receive", 101], ["receive", 102], ["read", 101]]Output1WhyOnly notification 102 remains unread.events = [["receive", 5], ["receive", 6], ["clear"], ["receive", 7]]Output1WhyThe clear removes 5 and 6, then 7 is added as unread.1 <= len(events) <= 10^5For `receive` and `read`, event format is `[type, id]` where `0 <= id <= 10^9`For `clear`, event format is `["clear"]`Notification ids are unique across `receive` eventsdef unread_badge_count(events):