As reported: Cisco, C++-focused role (2026): Valid Parentheses — asked in round 1 (online, among about four DSA questions) and again in round 2 (offline).
Given a string s of the characters ()[]{}, return true if every opening bracket is closed by the same type of bracket in the correct order, and every closing bracket has a matching opening one.
This is LeetCode 20 — Valid Parentheses.
Example 1
s = "()[]{}" -> true
Example 2
s = "(]" -> false
Constraints: 1 ≤ s.length ≤ 10^4; s contains only ()[]{}.
Code runner format: one line, s as a JSON string. Implement isValid(s); the harness prints true or false.