Ad
  • Custom User Avatar

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

  • Custom User Avatar

    Streams were introduced with Java 8 in Mar 2014. This kata is dated back to Dec 2013.

  • Custom User Avatar

    A nice kata with a very thoughtful set of tests. Considering the difficulty of much of the 6 kyu katas, this one might be a good fit for being 5 kyu.

  • Custom User Avatar

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

  • Custom User Avatar

    ...or, assuming left-to-right writing direction, right-aligned lines should be accepted in the mirrored text as default

  • Custom User Avatar

    Kudos for the original background story, and thanks for the old-school feeling! :-)

  • Custom User Avatar

    Random tests are there to ensure the robustness of your solution by checking cases not covered in the sample tests. Your best course of action depends on the number of failing test cases.

    • If some random tests are failing on your solution, there might be an edge case you haven't thought about. Look at the failing tests, find a pattern, figure out why your solution doesn't pass the test. If you found out, enhance your code so that it will not break on that specific pattern again.
    • If all tests are failing, you might have misunderstood the specification, or you chose a suboptimal approach. Read the task again, think it through, and come up with a better algorithm.
  • Default User Avatar

    Based on the examples, apparently a valid ID should have exactly 9 digits. Yet some solutions accept IDs with a different number of digits. Consider adding a test for this case.

  • Custom User Avatar

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

  • Custom User Avatar

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

  • Default User Avatar

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

  • Default User Avatar

    Extra "best practices" vote for thinking about the situation where the ball bounces exactly to the height of the window. I think none of the tests cover this specific situation.

  • Default User Avatar

    I agree, I'm definitely not at the point of being able to solve a 5kyu kata under 10 minutes. :-) It must be a quite old one based on a) the number of solutions, and b) the fact that most upvoted JavaScript solutions do not employ the padString() function introduced in ECMAScript 2017.

  • Custom User Avatar

    It took me 3 different approaches and 2 days, but finally got this one down to 90-120ms. Thank you for this very good and challenging kata!