leetle

Daily challenge for 2025-06-13

164. Design Phone Directory

Write a function solve that simulates a phone directory with operations: get next available number, check if number is available, and release a number. Given a list of operations, return the results.

Operations: ["get", "check", "release"]

Example:
Input: n = 3, ops = [["get"], ["get"], ["check", 2], ["get"], ["check", 2], ["release", 2], ["check", 2]]
Output: [0, 1, true, 2, false, null, true]

Run this challenge interactively in Python or JavaScript when the app loads.