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.
should not be best practice
I'm sure this solution works for all the test cases, but what if another data type such as array, hash or boolean was passed to this function? Didn't the problem specifically ask for an error message in response to a string?
spoiler flag, plz...
This comment is hidden because it contains spoiler information about the solution
So a possible solution would be to use sample(3)in order to check if only 3 randomly picked samples from the array are even, righ?
This comment is hidden because it contains spoiler information about the solution
I like this one. How does it perform performance-wise?
@Roots2D:
symbols.key(c) ensures that value 'c' has a proper matching key (an opening parenthesis).
If it did have a proper opening parentheses, then symbols.key(c) would return true.
If we didn't have it, then the block would return false if 'c' is anything other than an opening parenthesis.
Hope this helps
Let me know if you have any other questions
Huh... I didn't about the chr method. It gives you the first letter of a string. Cool
this fails in case of non equal either both odd or both even numbers
what is the significance of (if symbols.key(c) && symbols.key(c) != stack.pop) compared to (if symbols.key(c) != stack.pop)?
thank you el cortez! i wish every questions had an explanation.
Wait, what?
can anyone explain this?