Ad
  • Custom User Avatar

    I'm sorry. I had to relook at my code and saw that the error came bacause I was iterating with the actual elements. I changed it to their index and it's working fine now.

    Thank you.

  • Custom User Avatar

    Example:

    max_sequence([-21, -21, 29, 14, -25, -10, 9, 1, 9, -25, -11, -14, -1, -27, -4, 2, -3, 7, -7, -17, 9, 1, 10, 25, -29, 6, -21, -7, 25, 0, 24, -4, -10, -19, -23, 18, -22, 3, -7, -23, -22, -1, -23, -10, 19, 10, -22, 19, -16, 17])

    result: 43 should equal 49

    HOW?

  • Custom User Avatar

    I checked the solutions after the result of my code and the expected answers of some of the random sequences were constantly different.

    All I can say is the 'solutions' did not follow the instructions of the kata; which means the kata creator didn't understand their own kata.

    Example:

    max_sequence([-21, -21, 29, 14, -25, -10, 9, 1, 9, -25, -11, -14, -1, -27, -4, 2, -3, 7, -7, -17, 9, 1, 10, 25, -29, 6, -21, -7, 25, 0, 24, -4, -10, -19, -23, 18, -22, 3, -7, -23, -22, -1, -23, -10, 19, 10, -22, 19, -16, 17])

    result: 43 should equal 49

    HOW?

  • Custom User Avatar

    The timeouts are because the iterations are on s2 can be over 600,000. Using set(s2) limits the iteration to 26 because there are only 26 unique aphabets, so the iterations are 26 or less.