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: EASY. Variant: 19. Expect follow-up questions about complexity, edge cases, and alternative approaches.
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 easy difficulty.
The signed-in workspace provides the tools required by the round, such as recording, code execution, diagrams, structured notes, or evidence p