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.
Worst description i've ever read. sorry.
Let me know in comments if we can increase range of numbers in random tests, and whether an even faster ref sol can be used.
improved tests
added
done
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Looks like there is wrong mark in description in maxmimum word
python new test framework
thanks
I agree 100% that this is an off-by-one error. If, as the description suggests, the
target_floor
(highest floor before the egg breaks) is1 <= target_floor <= max_floor
, and we are to findmax_floor
, then(n, m) = (0, 0)
implies thatmax_floor = 1
.If you instead use the definition that
0 <= target_floor <= max_floor
then this is equivalent to solving the problem from the other perspective and then subtracting1
from the resultingmax_floor
. Indeed, if you consider the algorithm for finding thetarget_floor
, and if from the start it is assumed thatk <= target_floor
for somek
, then it is useless for the algorithm to check any floors at or belowk
. This effectively shifts the algorithm's search byk - 1
places and thus shifts the resultingmax_floor
by the same amount.Respectable approach for sure, but I still feel that being able to prove the answer is what you suspect it to be is also a pretty important skill (not sure if that's what you meant or not).
Realy good Kata! Thanks to author!
Dead problem 💀
Loading more items...