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.
The test cases are written the wrong way around, so the expected and actual values are flipped.
Also, this seems to lean a bit far on the physics side and not enough on the computer science side, but that's more my opinion
Thanks. I've updated the description accordingly.
It's assumed that the collision is perfectly elastic but it's not mentioned in the description.
If collision is not perfectly elastic the solution cannot be determined, e.g for perfectly inelastic collisions the answer is trivial but does not equal to the expected result.
Thanks for spotting that. I've updated the test cases to test solutions for that now.
With an initial velocity of
u = 0
there won't be any collision,which is not being tested for.
Yes, of course. Thanks for spotting that. I've fixed the solution now to remove the erroneous square.
The reference solution is wrong
Momentum is
p = mv
But the reference solution produces
mmv
Not clear?
Say inputs are
m kg
u (m/s)
and alpha an constantThen
p (kg*m/s)
But the reference solution returns
kg^2 * m/s
I had a little look at this Kata today and have a solution that solves the sample tests fine, but times out for the final tests. I'm finding it a little hard to find the root of the problem, as I'm unable to debug the cases. Any help would be greatly appreciated!