Ad
  • Custom User Avatar

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

  • Custom User Avatar

    I also have this problem. So ....

  • Custom User Avatar

    It doesn't return one char, but string which is part of one of the PIN strings. Like, for "123" input, p can be "12", for example, and d can be "3".

  • Custom User Avatar

    Thanks, got it!

  • Custom User Avatar

    All written tests are passing for me (thanks a lot for them!), but some tests running during submit are failing:

    1. all tests under "set/del-> redo tests" except the first one
      one undo call - Expected: {"x":5}, instead got: {"x":5,"y":6}
      one set call - Expected: {"x":5,"y":66}, instead got: {"x":5,"y":6}
      The objects does not change - Expected: {"x":5,"y":66}, instead got: {"x":5,"y":6}
      one undo call - Expected: {"x":5}, instead got: {"x":5,"y":6}
      one redo call - Expected: {"x":5,"y":66}, instead got: {"x":5,"y":6}
    2. 10th and 11th tests under "all mixed tests":
      Redo all actions - Expected: {"x":5,"y":8}, instead got: {"x":5}
      Redo three actions - Expected: {"x":55}, instead got: {"x":5}

    Since I don't see what are actions in these tests, it's really hard to investigate the problem... I would appreciate a hint. Thanks!

  • Custom User Avatar

    OMG this is crazy :) didn't even think about regex here, but it's a great example how regex can be applied

  • Custom User Avatar

    I'd suggest getting rid of code duplication here.