-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathq_10128_Valid_Parentheses.json
42 lines (42 loc) · 1.2 KB
/
q_10128_Valid_Parentheses.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
{
"question": {
"qid": "q_10128",
"diff": 1,
"tags": ["stack"],
"title": "Valid Parentheses",
"prompt": [
"Given a string {{ s }} containing just the characters {{ '(' }}, {{ ')' }}, {{ '{' }}, {{ '}' }}, {{ '[' }} and {{ ']' }}, determine if the input string is valid."
],
"examples": [
{
"input": "'()'",
"output": "true",
"explanations": [
"The input string '()' is valid because the brackets are balanced."
]
},
{
"input": "'([)]'",
"output": "false",
"explanations": [
"The input string '([)]' is not valid because the brackets are not balanced."
]
}
],
"constraints": [
"1 <= s.length <= 104",
"s consists of parentheses only: '()[]{}'"
],
"functionArguments": ["s"],
"hints": ["Use a stack to keep track of opening brackets."]
},
"testcases": [
{ "tid": "1", "input": ["()"], "expected": true },
{ "tid": "3", "input": ["([)]"], "expected": false },
{ "tid": "2", "input": ["()[]{}"], "expected": true },
{ "tid": "4", "input": ["(([]){})"], "expected": true }
],
"submitted": 0,
"accepted": 0,
"questionLevel": 3
}