NeetCode #30LC-1429MediumArrays & HashingNC Algo100
← Back to All Problems

#30 · #1429 · First Unique Number(第一个唯一数字)

📌 Problem Statement & Constraints

Design a class that supports adding numbers to a stream and returning the first unique (non-repeating) number. Implement showFirstUnique() and add(value). If no unique number exists, return -1. Constraints: 1 <= nums.length <= 10^5, 1 <= value <= 10^8; at most 5 * 10^4 calls to add.
🔒

Sign In to Unlock Full Solutions for All 973 Problems

Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!