Stack validation: Given a string containing only (), [], and {}, return whether every opening bracket is closed by the matching type in the correct nested order.
Input: A JSON object { "s": string }.
Output: A JSON boolean.
Constraints:
- 0 <= s.length <= 100000
- s contains bracket characters only
- The empty string is valid
Read one JSON value from stdin and print exactly one JSON-serialized answer to stdout with no extra text.
Difficulty: HARD. Variant: 9. Balance correctness, maintainability, and clear review-ready code.
Practice context
This coding (algo) exercise trains prompt interpretation, explicit assumptions, a concrete response, and a concise explanation of the decisions made. It is marked hard difficulty.
The signed-in workspace provides the tools required by the round, such as recording, code execution, diagrams, structured notes, or evidence panels. Attempts are