Ad
  • Custom User Avatar

    Now you got the logic right, but your code is timing out because you are computing sum of the long list twice in the for-loop. Instead, you can store the value before-hand or even better try to come up with an O(N) complexity-based algorithm.

  • Custom User Avatar

    Your code is timing out because you are computing sum of the long list twice in the for-loop. Instead, you can store the value before-hand or even better try to come up with an O(N) complexity-based algorithm.

  • Custom User Avatar

    sum(range(n+1))-(15+21)

  • Custom User Avatar

    Because of for chunk in range(0, len(chunks)):, each chunk is an integer. for digit in chunk: is you trying to for-loop over that integer, which makes no sense. I think you want for chunk in chunks:.

  • Custom User Avatar

    range(n) = sequence from 0 to n-1
    Hence, the sum is only upto 25

  • Custom User Avatar

    Your code has wrong indentation/closing braces.

  • Custom User Avatar

    sum(3) = 1 + 2, you're missing the last summand. 289 + 26 = 315.

  • Custom User Avatar

    Solutions and tests are concatenated in Python. If there's a syntax error in the first line of tests then it's probably due to an error in the last line of the solution.

  • Custom User Avatar

    Are you writing some code in the Sample Test panel? I've tested my code in both versions of Python and worked in both of them.
    Try clicking reset and give it another try. You can also paste your current code here (check Mark as having spoiler content below)

  • Custom User Avatar

    It worked for me, copy and paste the error it gives you.

  • Custom User Avatar

    When you ask for help don't post an issue - you make the author lose points - post a question. As you could have seen at the top of the page 6319 guys passed the kata (1945 with Python) so there is no error in the tests. Google "UnicodeEncodeError: 'utf-8' codec can't encode character '\udcc3' surrogates not allowed".