Ad
  • Custom User Avatar

    Description:

    If the input array is empty consider it as: [0] (array with a zero).

    But there are no empty arrays in the tests. That's too bad. Because in this case solutions with reduce would not work.

  • Custom User Avatar

    The reason of your problem is that you mix up, and seem to miss the difference, between numbers and digit characters. When you do odd = [1,3,5,7,9], then the list odd contains 5 numbers: 1, 3, 5, 7, and 9. When you do number = list(str(sum(arr))), the number list holds characters, for example: '1', '3', '5', '7', or '9'. That's why when you do number[-1] in odd you get no results: because for example '5' is not in [1, 3, 5, 7, 9].

    5 is, but '5' is not. You need to find out what's the difference between '1' and 1, or between '7' and 7.

  • Default User Avatar

    Thank you for the solution

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Because it is not correct.

    Without seeing your solution we do not know why it is not correct.

  • Default User Avatar

    Why my solution doesn't work?

  • Custom User Avatar

    I disagree, checking a number's parity is 8 kyu, checking the parity of the sum of all elements in an array is 7.

  • Default User Avatar

    too easy for 7 kyu

  • Custom User Avatar

    Thanks!

  • Custom User Avatar

    Approved

  • Custom User Avatar

    its 8kyu, not 7

  • Custom User Avatar

    I think it's okay to keep different types as inputs but the description is really off

    Given a list of integers

    in context of Haskell seems like a literal requirement for the arg to be [Integer] type

    There should be Haskell-specific description clarifying that input is a list of Integral derivative

  • Default User Avatar

    wouldn't it be fine if simply defining the type in the default code? it's quite odd for the solver to specify the type when they don't .. know what it should be

  • Custom User Avatar

    Yeah, that's nowhere remotely close to what the kata is supposed to test, which is a problem in itself.

  • Custom User Avatar

    It's solvable using typeclasses

    But yeah it does put more of a challenge compared to other languages

  • Loading more items...