# Generate Collision-Safe Short Codes
A URL shortener maps a random code to a long URL. Codes must be
unpredictable (`secrets`, not `random`) and unique against existing codes.
### Task
Implement `mint_code(existing: set[str], length: int = 7) -> str` that returns
a `[A-Za-z0-9]` code of `length` chars not present in `existing`, retrying on
collision (give up after 1000 tries and raise `ValueError`).
### Example
`mint_code({"abc1234"})` → a 7-char code not equal to `"abc1234"`;
`mint_code(set(), length=4)` → any 4-char code.