Ad
  • Custom User Avatar

    Codewars katas ALWAYS have you returning stuff instead of printing them out like other programming websites. Honestly, it's a much better way to do it.

    And yes, that's probably where you've gone wrong. Hope it helps!

  • Custom User Avatar

    You're iterating over array2 and if array2 is an empty array [], then it's a NoneType, which is therefore, not iterable. Maybe add an exception handler or a check at the start of the code, that should help. :)

  • Custom User Avatar

    The first test case passes an empty list. That's probably the reason.

  • Custom User Avatar

    I think with a better description and an example or two, this could be bumped down to 4 or 5kyu. Nevertheless, was fun to do. :D

  • Custom User Avatar

    Some random test cases would be nice. Also, I'm really nitpicking here but I saw some of the test cases expecting values rounded to 1 decimal places (i.e 200.00 was 200.0)

    It's not much but it still got me wondering for a second if I should round to two decimals like you said in the question or if it should be one, so, just thought I'd point that out. Otherwise, nice kata!