NeetCode #166LC-379MediumArrays & Hashing
← Back to All Problems

#166 · #379 · Design Phone Directory(电话目录)

📌 Problem Statement & Constraints

Design a phone directory that assigns numbers in the range [0, maxNumbers - 1]. Implement get() returning an available number (or -1 if none), check(number) returning whether the number is available, and release(number) returning a number to the pool. Constraints: 1 <= maxNumbers <= 10^4; at most 10^4 calls.
🔒

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!