Valid Parentheses (Rust)
Source: LeetCode #20
Topics: stack, strings
Problem
Given a string s containing only the characters ()[]{}, return true if every bracket is
closed by a bracket of the same type, in the correct order.
is_valid("()[]{}") // true
is_valid("(]") // false
is_valid("([{}])") // true
is_valid("([)]") // false
Grading
Your solution.rs is compiled together with a trusted tests.rs (which include!s it) using
rustc --test. Only solution.rs is yours to edit.
Sign in to submit your solution.