Added Readme and testdata

master
Christoph Prybila 3 years ago
parent 5c15226d3c
commit feed77f12a

@ -0,0 +1,16 @@
# Test a String for '(),[],{}' well-formedness
## Goal
A string over the characters `()[]{}` is said to be well-formed, if the different types of brackets match __in the correct order__.
Write a program that outputs `true` or `false` depending on the well-formedness of the input.
### Example
| Input | Output |
|----------|--------|
| ([{}])() | true |
| ([)] | false |
### Constraints
Input strings consist only of characters `()[]{}`

@ -1 +1 @@
rootProject.name = 'template'
rootProject.name = 'is-string-well-formed'

@ -0,0 +1,15 @@
(),true
{},true
[],true
()(),true
(()),true
[]{},true
{[]},true
()[()]({[()]})([]),true
(,false
],false
{],false
(},false
([)],false
{(((([))))}],false
()[()]({[[(])]})([]),false
1 () true
1 () true
2 {} true
3 [] true
4 ()() true
5 (()) true
6 []{} true
7 {[]} true
8 ()[()]({[()]})([]) true
9 ( false
10 ] false
11 {] false
12 (} false
13 ([)] false
14 {(((([))))}] false
15 ()[()]({[[(])]})([]) false
Loading…
Cancel
Save