Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Could someone provide a hint on this, considering that one already has the linear time solution?
As a side note, IMHO, if linear time is not enough, I would remove the dynamic programming tag.
This comment is hidden because it contains spoiler information about the solution
The ray gets immediately reflected after travelling zero units. You can consider -a as the angle for h == 1 and a > 0
Could someone please explain how shall one consider the test cases where h == 1 and a > 0?
It would be helpful to add at least a long range test to the basic tests.
Strictly speaking, this is not needed...
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This was definitely fun, but I wouldn't call it simple. :)
First of all, really nice kata. :)
Could someone tell me what are the performance requirements (Python translation)? I'm passing ~400 test cases before it times out. Am I far away from the finish line?
Yes, my initial approach was very inefficient, but now I finally nailed it! :)
It's a very nice kata, great job!
Thanks for the quick reply.
Unfortunately, your reply to centosette is hidden to me, but Google helped me out. :)
The two hints are not mutually exclusive; there are good solutions that use them both. If you want to know how to calculate areas of triangles without using square roots, see the reply to centosette below.
The test cases don't include any huge examples, so runtime shouldn't be a problem unless your solution is very very inefficient.
Loading more items...