Byte quota enforcement
Your task
Track space usage under a byte quota. A store maps string keys to blob sizes (bytes) and enforces a fixed quota on total bytes used. Process operations: ["write", key, size] attempts to store/overwrite key with a blob of size bytes, it succeeds only if total used bytes AFTER the write would be <= quota (when overwriting an existing key, the old size is released first for this check); on failure the write is rejected and the key keeps its previous value (or stays absent). ["delete", key] removes key and frees its bytes (no-op if absent). Return a list of booleans, one per "write" op in order, indicating whether each write succeeded. size >= 0; <= 10^5 ops.
Examples
quota_writes(quota: int, ops: list[list]) -> list[bool]Example 1
Input
quota_writes(10, [["write", "a", 6], ["write", "b", 6], ["write", "b", 4]])Output
[True, False, True]