Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Instead of
.chars.each
,.each_char
is also possible.So eloquent ! Well played 🚀
elegant
mind-blowing!
wow perfect!
^ Pretty
Genius!
this is handled by the
return false if open < 0
lineMaybe I"m missing something but this fails with a string of "((" or even "(()(" no?? Granted i didn't solve it..just trying learn
No problem. Thanks for getting back to me, your explanation clarified things quite a bit.
Hey
Sorry for the delay.
It is called conditional operator, or ternary operator.
It work like this:
value = if_this_is_a_true_value ? then_the_result_is_this : else_it_is_this
http://stackoverflow.com/questions/4252936/how-do-i-use-the-conditional-operator-in-ruby
If you have other questions regarding programming, I am happy to help.
Hey there, kweblify.
I like your solution, very clean. I was wondering if you might briefly explain -- or point me towards some good resources for -- that '?' operator between the indices? Specifically, what is that final line doing? I'm quite new to programming and I'm finding difficulty optimizing my clunky, messy code. Thanks!
E.N.