Ad
  • Custom User Avatar

    Your keys might have changed. If the original arrays is

    0 => 0
    1 => 2
    2 => 2
    3 => 0

    and your array is

    0 => 2
    1 => 2
    4 => 0
    5 => 0

    the test will expect to see an array with the same values but 0, 1, 2, 3, keys

  • Default User Avatar

    yes, my first time completing a 4 kyu kata:)
    just got a little excited when i saw that the code actually worked.
    I'll probably refactor it later
    Thanks anyways

  • Custom User Avatar

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

  • Custom User Avatar

    Overly complicated recursive solution, i'm not even sure how and why this works tbh, especially the end of my for loop.

    If else:
    continue
    is not present the solution doesn't work, i'm also not sure what res does exactly...

    At this point my head hurts, if someone can explain this to me i'd appreciate it.

  • Custom User Avatar

    Is it possible to improve performance by caching some of the recusive function calls results ? functools.lru_cache() doesn't work because 1 digit matrixes are not hashable.

    My solution works, but takes up to 9 seconds to resolve the tests, and none of the test go higher than a 8 digit matrix iirc