Ad
  • Custom User Avatar

    Do NOT put your reference solution in Preloaded. Put it in Test Cases. Code in Preloaded is available to call for the user solution.

    (People that have solved your kata can see Preloaded when they Fork a solution BTW. Or is this only visible to people who can edit the kata anyway?)

  • Default User Avatar

    One alternative (I hesitate to call it a "better method") is to put your own solution in the "Preloaded" section of the Kata.

    Then all you need to do is call it (from both random tests and complete solution) instead of cut/paste the whole thing.

    But if you do this then nobody (including other people that solved your Kata) will ever get to see your working solution.

  • Custom User Avatar

    That would define things twice, because the Complete Solution is a valid solution with all the same names the user will be creating.

    The simple answer to your question is no.

    Sorry. :S

    (Fortunately, you have a working solution; you only need to include it under another name. :P )

  • Custom User Avatar

    The message doesn't mean that the way you produce your commands is not optimal, but rather that your command list itself is not optimal. That is, there is a shorter list of commands to the destination.

    The problem description of the problem states that you need to return the shortest path:

    Your task is to write a function, which returns the list of commands, Robby has to do in order to reach the target cell and save as much power as possible.

  • Custom User Avatar

    I'm not sure what you mean. Whatever it is, it was a coincidence, as ES2015 wasn't really a thing back when I did this (2013)!