+ 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
16 Respostas
+ 10
https://code.sololearn.com/cUBsGXRMuKZ1/?ref=app
+ 12
I kinda of abandoned my coding challenges, but they will come back soon :)
+ 12
@Pixie I think I fixed it now.. Thank you for the best answer, but I think @Burey deserves it :)
+ 12
@Burey *_*
+ 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
+ 10
i don't do it for best answer >:D
is fun that's all :)
give it to someone worthy thy lord (.)_(.)
+ 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 âș
+ 9
@Gami "))((" is given as true. It should be false
+ 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. đ
+ 9
go Gami go >:D
+ 8
Thanks @Sagheb. Try to solve it if you can âș
+ 8
+ 5
https://code.sololearn.com/czdKJgoni0L9/#java
+ 3
Oh this one is nice. Appreciate for putting your solution too.