+ 16

Challenge::Expression Validity

Write a program that takes an expression containing brackets as input and outputs whether the expression is valid or not Example: input:(){}[] output:Valid input:{[()]} output:Valid input:{([)]} output:Invalid input:}{}] output:Invalid Happy coding! Any language is welcomed..😃😃😃

12th Feb 2018, 1:07 PM
Md. Nafis Ul Haque Shifat
Md. Nafis Ul Haque Shifat - avatar
15 Réponses
13th Feb 2018, 12:28 PM
LukArToDo
LukArToDo - avatar
+ 10
https://code.sololearn.com/cU0SEGA7PQ7A/#cpp
12th Feb 2018, 2:46 PM
Cool Codin
Cool Codin - avatar
14th Feb 2018, 6:22 AM
Käzî Mrîdùl Høssäîn
Käzî Mrîdùl Høssäîn - avatar
12th Feb 2018, 1:16 PM
Hrishikesh Kulkarni
Hrishikesh Kulkarni - avatar
+ 4
Easier with regexp + replace. https://code.sololearn.com/W8WcMPIvwjrG/#js
12th Feb 2018, 5:08 PM
Luc Hariman Randrianomenjanahary
Luc Hariman Randrianomenjanahary - avatar
12th Feb 2018, 7:28 PM
VcC
VcC - avatar
12th Feb 2018, 2:19 PM
Jonathan Pizarra (JS Challenger)
Jonathan Pizarra (JS Challenger) - avatar
13th Feb 2018, 5:28 PM
VcC
VcC - avatar
+ 1
its a brace validator..with possible mentions of where the string you had given went wrong...try it with worst inputs... https://code.sololearn.com/c1yCwEP85HQ2/?ref=app
12th Feb 2018, 5:55 PM
sayan chandra
sayan chandra - avatar
12th Feb 2018, 6:42 PM
Luis Lopes
Luis Lopes - avatar
+ 1
@luis great idea but does not work for ([)]
12th Feb 2018, 6:51 PM
VcC
VcC - avatar
+ 1
ya....luis...theres more with validation...count cant handle it... both count are equal - is just an element of set with all "to be checked" criterias....
12th Feb 2018, 6:53 PM
sayan chandra
sayan chandra - avatar
+ 1
Ok I'll fix it Now it's fixed
12th Feb 2018, 6:54 PM
Luis Lopes
Luis Lopes - avatar
14th Feb 2018, 2:16 PM
Nitzan
Nitzan - avatar
+ 1
@md who s winning this challenge ?
15th Feb 2018, 7:47 PM
VcC
VcC - avatar