Ad
  • Custom User Avatar

    A solution like this showcases how the ceiling for coding is raised with advanced math knowledge. It is not the 'best practice' because everyone should be expected to reach this conclusion. It is the 'best practice' because it is the simplest and most efficient solution.

  • Custom User Avatar

    This is very confusing, kata description should be updated. Below is the simplest way I can think to write this:

    • "sharkDistance = Shark's distance from Beach (in metres). If shark can get here before you, it will eat you."
    • "pontoonDistance = Your distance from Beach (in metres). If you can get here before the shark, you will live."

    The two following examples are all 'aligned in 1 dimension', based on how it is written now:

    • Shark --> Pontoon --> You --> Beach = Shark traversing both distances succeeds for test examples, but not random.
    • Pontoon <-- Shark --- You --> Beach = This is the intended? But shark is just racing you to a different location?
    • Pontoon --- You <-> Shark --- Beach = Random test generates these with wrong interpretation, since you would always die.

    This is how it should be viewed:

    • Shark --> You --> Beach = You could live, depending on speeds and distances.
    • You --> Shark --> Beach = It should technically still eat you no matter what, but at least you're racing in the same direction?
  • Custom User Avatar

    I always enjoy a good geometry kata, but it may help to stipulate that the arc is always 90°.
    The description states the area is square (which implies 90°), but it could be a little more clear for an 8kyu kata.

  • Custom User Avatar

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

  • Custom User Avatar

    Not a kata issue, and changing that now is unfair.

  • Custom User Avatar

    Tests don't account for hyphenated or double names ('Amelia-Rose', 'Mary Jane', etc.)

  • Custom User Avatar

    Tests don't account for hyphenated or double names ('Amelia-Rose', 'Mary Jane', etc.) but this solution does.

  • Custom User Avatar

    It's a special character in regex, it matches to any single character except line terminators.
    So: /.*/ = any character any number of times

  • Custom User Avatar

    The longer I look at it, the more beautiful it becomes...