CodeMentor
.
Ask AI
Problems
Learn
C++
TCS
Core CS
HR
Progress
Search
Ctrl
K
0
Lv 1
Problems
Stack & Monotonic Stack
Valid Parentheses
Easy
LeetCode
1/3
00:00
Hint
Run
Ctrl
↵
Submit
Description
Lesson
Code walk
Solution
Easy
Stack & Monotonic Stack
LeetCode #20
Valid Parentheses
Stack of opens. On close, top must match. Empty at end.
Examples
Example 1
Input
()
Output
true
Example 2
Input
()[]{}
Output
true
Stuck? Take a nudge
Reveal hint 1 of 3
C++17
Autosaves
Reset
Console
Run your code to see results