+ 11

Coding Challenge #4: Validate Parantheses (Code included)

Parentheses Validation (By: cheeze) Create a function validate() that accepts a string of parentheses as an argument and validates whether the parentheses are balanced. e.g. validate("()()(()())") // true e.g. validate("())(()") // false e.g. validate("()((()))") // true EDIT: For those who want something more challenging, check out Burey's code here, validating ({[]}) with an expression and try to do that. Thanks for posting it here Burey 😊 https://code.sololearn.com/cuxC4syg7208/?ref=app

14th May 2017, 7:03 PM
Pixie
Pixie - avatar
16 Answers
+ 10
https://code.sololearn.com/cUBsGXRMuKZ1/?ref=app
14th May 2017, 7:11 PM
Gami
Gami - avatar
+ 12
I kinda of abandoned my coding challenges, but they will come back soon :)
14th May 2017, 7:13 PM
Gami
Gami - avatar
+ 12
@Pixie I think I fixed it now.. Thank you for the best answer, but I think @Burey deserves it :)
14th May 2017, 7:23 PM
Gami
Gami - avatar
+ 12
@Burey *_*
14th May 2017, 7:34 PM
Gami
Gami - avatar
+ 10
xD i have done that long ago https://code.sololearn.com/WKyZXYO8hsH5/?ref=app [edit] made some updates to the parser go check it out
14th May 2017, 7:14 PM
Burey
Burey - avatar
+ 10
i don't do it for best answer >:D is fun that's all :) give it to someone worthy thy lord (.)_(.)
14th May 2017, 7:20 PM
Burey
Burey - avatar
+ 10
@Gami Burey's code is very good but you posted it first, and also for the challenge. You deserve it 😉. In fact, I added what Burey did as the harder version of the challenge. Try to do it if you can ☺
14th May 2017, 7:25 PM
Pixie
Pixie - avatar
+ 9
@Gami "))((" is given as true. It should be false
14th May 2017, 7:13 PM
Pixie
Pixie - avatar
+ 9
@Burey. "I did that long ago" So..... idk whether to give the best answer to you or not, cause your code also checks for {} and [] as well 😮 and it is really good but you didnt do it for the challenge 😓 In fact, I'll add your post as the harder version of the challenge. 😎
14th May 2017, 7:18 PM
Pixie
Pixie - avatar
+ 9
go Gami go >:D
14th May 2017, 7:27 PM
Burey
Burey - avatar
+ 8
Thanks @Sagheb. Try to solve it if you can ☺
14th May 2017, 7:10 PM
Pixie
Pixie - avatar
15th May 2017, 4:22 AM
Vaibhav Sharma
Vaibhav Sharma - avatar
+ 5
https://code.sololearn.com/czdKJgoni0L9/#java
14th May 2017, 7:30 PM
Tamás Barta
Tamás Barta - avatar
+ 3
Oh this one is nice. Appreciate for putting your solution too.
14th May 2017, 7:07 PM
Sagheb
Sagheb - avatar