Earn extra honor and gain new allies!
Honor is earned for each new codewarrior who joins.
Learn more
  • Prolog translation kumited. (author inactive)

  • Ah thank you both! Got it now

  • You're checking for empty arrays in a wrong place.

  • Your loop will never run if the list is empty, check where you check for empty list.

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

  • What language are you attempting? What's your attempted solution (post using spoiler tag)? What inputs are you claiming the test is failing on - be specific, e.g. "for input x I get y but test says z" - that way people can help identify if a problem with the test case(s) or your code.

  • All tests passed except the last one. Given an array with negative numbers, but test doesn't expect null. Shitty Kata.

  • It was a problem with your code. Not a kata issue.

  • You're probably parsing the number and that fails because they're too big. Try another way.

  • Expected: '[9, 2, 2, 3, 3, 7, 2, 0, 3, 6, 8, 5, 4, 7, 7, 5, 8, 0, 8]', instead got: '[9, 2, 2, 3, 3, 7, 2, 0, 3, 6, 8, 5, 4, 7, 7, 6, 0, 0, 0]'
    Expected: '[9, 2, 2, 3, 3, 7, 2, 0, 3, 6, 8, 5, 4, 7, 7, 5, 8, 0, 7, 5, 3, 2, 6, 7, 8, 4, 2, 4, 2, 6, 7, 8, 7, 4, 5, 2, 2]', instead got: '[9, NaN, 2, 2, 3, 3, 7, 2, 0, 3, 6, 8, 5, 4, 7, 7, 6, NaN, NaN, 3, 6]'

    i'm passing all other test specs

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

  • Try using print(arr) to check what the input is, the whole error message is this ValueError: invalid literal for int() with base 10: '' empty string can't be converted to an int value.

  • Post your code, using markdown formatting and mark your post as having spoiler content.

  • I see your point, but the value I'm trying to convert are string type numbers: '500'

    I also pass every test case. The code both converts to int type and give error at the same time.

  • You're trying to convert something to an int that cannot be thus converted. You should see this value after the error message. For example, trying to convert 'spam' to an int produces this: ValueError: invalid literal for int() with base 10: 'spam'

  • Loading more items...