Ad
  • Default User Avatar

    Ruby here. Anchor 1 is teams[0][0] and anchor 2 is teams[1][-1] because arr[-1] returns the last element of the array arr. If your lang isn't this convenient, I submit my totally unbiased opinion that you should switch to the best language, Haskell Ruby.

    Honestly, it's much more important that the test cases are random or numerous or both. With a low-level kata like this, people may be tempted to hard-code the final answers.

  • Custom User Avatar

    I think that's a good idea, though I would suggest forking it and making the team sizes variable (in the description, it's clear that there are 5 team members, and for a lower kyu problem, that makes sense to me). A further complication could be added by making the surfaces the teams are standing on of different materials, so they are more or less grippy/slippery.

  • Custom User Avatar

    It's important that the lengths of the test cases vary. Otherwise one could simply hard-code the anchor indexes.