Question
## Scenario
Implement a small spreadsheet that stores numeric cells and formulas. A formula may reference other cells, and reads must reflect the latest values after any update.
Support formulas consisting of cell references, numeric literals, parentheses, and the arithmetic operators `+`, `-`, `*`, and `/`. Cell names contain uppercase letters followed by a positive row number, such as `A1` or `BC12`.
## Interface
```python
class Spreadsheet:
def __init__(self) -> None: ...
def setCell(self, key: str, value: str) -> None: ...
def getCell(self, key: str) -> float: ...
```
## Requirements
- `setCell(key, value)` stores either a numeric string such as `"12.5"` or a formula beginning with `=`.
- `getCell(key)` recursively evaluates the current value of the cell.
- A reference to a cell that has never been assigned evaluates to `0`.
- Updating a referenced cell must affect subsequent reads of every dependent formula.
- Detect direct and indirect cycles and raise `ValueError` with a message containing `"Circular dependency"`.
- Do not use unrestricted language evaluation. Parse or safely interpret only the supported grammar.
- You may evaluate lazily. Values within `1e-6` of the mathematically correct result are accepted.
Assume cell names and formulas are syntactically valid unless a cycle occurs. Division by zero may propagate as an exception.
## Examples
```text
setCell("A1", "10")
setCell("A2", "5")
setCell("B1", "=A1 + A2 * 2")
getCell("B1") -> 20
setCell("A2", "7")
getCell("B1") -> 24
```
## Follow-ups
1. Maintain a reverse dependency graph and eagerly invalidate or recompute affected cells.
2. Add ranges and aggregation functions such as `SUM(A1:A10)`.
3. Support concurrent edits from multiple users. Define conflict semantics before choosing locks or optimistic concurrency.
4. Persist a workbook while preserving formulas and deterministic recalculation.