Valid Parentheses

Given a string s containing only the characters (, ), {, }, [ and ], determine whether the string is valid.

A string is valid if:

  1. Open brackets are closed by the same type of bracket...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: