Ad
  • Default User Avatar

    Instructions are not precise, the length of array are not always 5 in random tests. Downvote for author :)

  • Default User Avatar

    Well, I solved it by making a very simplistic (after all you only ever have 3 choices for each state) decision tree. It's by no means as complex as even a basic 'real' tree, but still other people solved it in +-5 lines of code by reverse Engineering the game logic.
    It's really your call whether you want to do the same and get the easy logic solution, or instead use this as decision tree training.

  • Custom User Avatar

    You can solve it using math in O(1).

  • Custom User Avatar
  • Custom User Avatar

    it's not about math, it's about mem and alg optimization. Brute algoritm don't work.

    Looks like most interesting kata so far