Ad
  • Custom User Avatar

    Currently it's enough with reading carefully the description.

  • Custom User Avatar

    The current description is fine with this.

  • Custom User Avatar

    The current description is fine

  • Custom User Avatar

    Done

  • Custom User Avatar

    Not a kata suggestion.

  • Custom User Avatar

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

  • Custom User Avatar

    there is such a thing as markdown formatting, particularly for code you enclose it in triple backticks:
    ```
    your code
    ```

    anyway, from what I managed to clean from that mess is that you're mutating the array while looping over it. don't do that. If you delete items, the arrays size changes, and so your n will quickly become invalid as it is now too large.

  • Custom User Avatar

    Don't post solutions in Discourse, and use a spoiler flag as soon as you post code somewhere (I put the flag on for you this time).

  • Custom User Avatar

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

  • Custom User Avatar

    Your code is buggy and producing an error. It tells you exactly what the error is: arr[n] is not in a. Insert print statements to track the values and pinpoint what is going wrong.

  • Custom User Avatar

    Traceback (most recent call last):
    File "/workspace/default/tests.py", line 38, in
    test.assert_equals(dirReduc(a), ['NORTH', 'NORTH'])
    File "/workspace/default/solution.py", line 5, in dirReduc
    a.remove(arr[n])
    ValueError: list.remove(x): x not in list
    having this issue showing passed and shows exit code:1