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.
Nice Kata.
If you have some trouble solving it... ask yourself why.. geometry tag was set... And be ready to draw and sketch (and scratch your head)...
Sorry that I didn't have a chance to get more into this, but it looks like you did it yourself!
Ah I see, further work needed...
This comment is hidden because it contains spoiler information about the solution
Also the "Geometry" tag might be helpful.
They don't necessarily arrive on the minute intervals. Your calculation is approximately correct, but not accurate enough.
To the serial downvoter, I will find out who you are, do worry about it.
Montecarlo is meant to time out. You need a more optimised solution. It doesn't hurt learning about Bayesian Statistics.
I assume I am missing something but I'm confused by the 18.75 value for the example. The boy arrives from 07:55 to 08:01 which is 7 different arrival times (55, 56, 57, 58, 59, 00, 01), the bus arrives between 07:58 and 08:02 giving 5 different arrival times (58, 59, 00, 01, 02). Therefore there are 7*5=35 total scenarios, of which 6 mean he will miss the bus:
boy arrives at 07:59, bus arrives at 07:58,
boy arrives at 08:00, bus arrives at 07:58 or 07:59,
boy arrives at 08:01, bus arrives at 07:58, 07:59, or 08:00
So 6 misses out of 35 total scenarios is 17.14% ?
What am I missing?
This comment is hidden because it contains spoiler information about the solution
Nice problem, but it's hard to debug, because printing out the input fulls the buffer because the random tests are so long.
It would help to either display the input on the first failing random test, or add two more cases to the sample tests:
A case where the initial position is not on the top floor.
A case where the initial position is on the bottom floor, but there's more than one floor.
Nice problem, thanks!
Minor suggestions:
It would be would be helpful to have an example, either in the description or the sample tests, where upgrading as soon as possible is not part of the solution.
Display the parameter values for each random test. It helps with debugging, and saves the user having to print them out.
Include what "cpc" stands for.
Explain what n refers to in "The reference solution executes with O(log n) taking less than 1s."
It's not clear why "numpy" is included in the tags. Maybe either explain why or remove it.
There's this:
https://www.codewars.com/kata/6378d155233c3f004a3bcef0/haskell
Not sure if it's quite the same as minimising the bit count. Needs a Python translation in any case.
Great problem, thanks! I've never used Fractions so extensively.
Finding the fraction from the final interval which minimises the number of bits was harder than I expected. It might be worth making a separate kata out of it.
Thanks!
Loading more items...