Ad
  • Default User Avatar

    That's an issue with your solution, not with the kata.

  • Default User Avatar

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

  • Default User Avatar
  • Default User Avatar

    done

  • Default User Avatar

    Should "A۱" count as "A1"? I see some python solutions that convert the second character to int, and "۱" converts to 1

    Of course, the invalid input requirement is dumb, especially non-strings or strings that don't describe a location in a coordinate system. But if you're gonna have it...

  • Default User Avatar
  • Custom User Avatar

    I found the error. Thank you:)

  • Default User Avatar

    As funny as I think it is to find a comment like this on a g964 kata, I see no issue here. Part of solving a problem is identifying what the problem is. There's no obligation to describe the problem in as simple terms as possible.

  • Default User Avatar

    Some description problems:

    You are given a non-null array of integers.

    drop "non-null". null is not an array. You also don't need to mention that the array isn't going to be a giraffe, tea cup, or banana.

    --

    method

    I would rather see function, or drop the word entirely, but this is nowhere near as offensive as the null thing

    --

    nowhere in the description does it say that there can't be gaps in the tree, such as:

            17
           /
          0
         /
       -4
       /
      3
     /
    15
    
  • Default User Avatar

    If a chunk represents an integer such as the sum of the cubes of its digits is divisible by 2

    ->

    If the sum of a chunk's digits is divisible by 2

    There was an issue about it 7 years ago which for some reason got marked resolved.

  • Default User Avatar

    You've got plenty to go on though. Compare the two results. Do it manually/consider which is correct. Read instructions.

  • Default User Avatar

    don't do bad things with memory /shrug

    might want to reproduce it locally where you have access to more tools.

    or use a different language that has better memory safety if this isn't something you want to deal with

  • Default User Avatar

    I made two forks that address mutability:

    1. Immutable dataclass Node - being immutable makes it very simple
    2. Check for mutation - complicated mess, obviously

    Both expect specifically IndexError. Unclear whether that change should be made though. It's not necessarily incorrect by codewars standards to raise an unspecified exception, and this breaks the vast majority of solutions, including ones that I would consider completely correct with the current spec.

  • Default User Avatar

    As a bonus this solution works for infinite lists and negative index because it'll hit recursion limit. (doesn't work as great for high indices though)

  • Default User Avatar

    Unspecified. The choices of excption type look strange across the board. java accepts any exception type according to description (haven't looked at tests) and C# doesn't use IndexOutOfRangeException which I assume is more appropriate and PHP might have something like that exception too instead of InvalidArgumentException .. OutOfRangeException looks to be a thing. Ruby accepts both throw and raise for some reason.

    Some languages return the data which seems more in line of the intent of the kata, while others the entire node, but don't bother checking if it's the correct node.

    This is fine.

  • Loading more items...