Ad
  • Custom User Avatar

    This also happens if you use []rune to store the output.
    Need to use []byte, then it'd pass.

  • Custom User Avatar

    I was debugging and judging by test results any act of evaluating loop brackets should increment the amount of completed iterations. It's not in line with instruction, which says:

    Regarding iterations, the act of skipping to the matching ] when a [ is encountered (or vice versa) is considered to be one iteration regardless of the number of command characters in between. The next iteration then commences at the command right after the matching ] (or [).

    It should either mention explicitly that even if we don't skip to matching bracket it should count as iteration, OR they should change tests to reflect that.

  • Custom User Avatar

    I suggest author adds a specific test for case [1, 2, 3, 2, 1] so that mutually exlusive copmressability is addressed. I made an implementation first that passed all the tests but for this edge case corrupted data like '1,3:3-1'.

    In my final solution i made assumption that in this particular case we shouldn't donate anything to the right sequence because it wouldn't improve nor degrade the outcome, whereas in other cases (when left side is not affected) it clearly improves the outcome.

  • Custom User Avatar

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

  • Custom User Avatar

    If result of .map is discarded then it's misused.