Algorithm · DoorDash · Medium
First Unique Number Medium · Topics · Company Tags · Hints Design a class FirstUnique that processes restaurant IDs as an online stream. It must track how many times each restaurant ID has appeared so far, and support returning the restaurant ID that appeared earliest among all IDs whose current occurrence count is exactly one. If no such ID exists, showFirstUnique() should return -1. Implement the following methods: FirstUnique(int[] nums) initializes the structure with the…
Checking your access…