Design an ID Allocator (Assign and Release)
Given an integer N, design an ID allocator with two functions:
assign(): return an unused ID in the range[0, N-1], or-1if none is available. The original problem does not restrict the ord...
Example
Unlock to view complete problem details
and practice with sample input/output
Was this article helpful?
View Test Cases & Run Code requires membership
Standard Input
Execution Result:
