Ad
  • Custom User Avatar

    Mind if you explain the code...very nice solution by the way

  • Custom User Avatar

    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.

  • Custom User Avatar

    it looks amayzing, but we could have got a crush case if user set a negative number.

  • Custom User Avatar

    You mutated the input.

  • Custom User Avatar

    Hi iphark. For this particular kata, research "lookahead assertion", "character set", and how the ^ (carat) and $ (dollar sign) work in regex. Hopefully this helped!

  • Custom User Avatar

    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!

  • Custom User Avatar

    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.