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.
You're not alone ;)
Ah yes, I see it now. Very elegant method.
I need to remove all non-parentheses characters for this:
string.replace("()", "")
Oh right, the return not string line only works if the string contained only parens at the start. Nice!
This comment is hidden because it contains spoiler information about the solution
Why do you need the first line of the function definition here? Would this solution not work without first creating a string of only parens? Is it an efficiency thing perhaps?
Given a string, return True if that string can be typed by alternating left hand and right hand key presses. For example, the string 'if' should return true, because 'i' is typed with the right hand and 'f' with the left hand. The string 'word' should return False, because 'r' and 'd' are both typed with the left hand.