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.
Mind if you explain the code...very nice solution by the way
It's a good solution.
I didn't know about filter function only needs a conditional to filter lists.
Well. It was more simple solution than mine.
it looks amayzing, but we could have got a crush case if user set a negative number.
You mutated the input.
Hi iphark. For this particular kata, research "lookahead assertion", "character set", and how the ^ (carat) and $ (dollar sign) work in regex. Hopefully this helped!
I'm new to regex, but it seems that you don't allow for a reoccurrence of any letters or numbers.
For example:
"(?=.[a-z])" returns the first instance of any lowercase letter, but does not allow for duplicates.
"(?=.*[a-z])" returns the first instance of any lowercase letter, but the asterisk symbol allows for 0 to infinite repititions.
When I modified my code that passed all tests to remove the asterisk symbol so it look like yours, my test failed. Also, you should (from what I've read) place the "{6,}" after the "(?=.\d)" and add a "$" at the end to tell regex that the string is done (good habits to reduce errors when dealing with multiline comments if you ever do). Hopefully this helped!
Received output "It should work for random inputs too: ['a', 5, -5, -2, 'x', -3, 'pippi', 0, 0] should equal ['a', 5, '0', -5, -2, 'x', -3, 'pippi', 0]".
The answer from the kata does not move all 0's to the back.