From feed77f12a0e8d40daa189c7060cacc085e14613 Mon Sep 17 00:00:00 2001 From: Christoph Prybila Date: Tue, 25 Feb 2020 21:44:05 +0100 Subject: [PATCH] Added Readme and testdata --- README.md | 16 ++++++++++++++++ settings.gradle | 2 +- src/test/resources/testdata.csv | 15 +++++++++++++++ 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e69de29..4f6e9a1 100644 --- a/README.md +++ b/README.md @@ -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 `()[]{}` diff --git a/settings.gradle b/settings.gradle index d5271ef..73d7856 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1 @@ -rootProject.name = 'template' +rootProject.name = 'is-string-well-formed' diff --git a/src/test/resources/testdata.csv b/src/test/resources/testdata.csv index e69de29..057eed3 100644 --- a/src/test/resources/testdata.csv +++ b/src/test/resources/testdata.csv @@ -0,0 +1,15 @@ +(),true +{},true +[],true +()(),true +(()),true +[]{},true +{[]},true +()[()]({[()]})([]),true +(,false +],false +{],false +(},false +([)],false +{(((([))))}],false +()[()]({[[(])]})([]),false \ No newline at end of file