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.
same bro, i hate that int(), it doesn't make any sense mathematically speaking :(
I swear to god, I had the same answer but it timed out on tests, so I had to forfeit it. Glad yours passed though.
Hey, that walrus operator line is pretty neat.
Agreed on the rounding constraint. The partial persons in the intermediate results are essentially just modeling variance in the year-to-year growth rate. (E.g., 1/3 of a person per year just means every third year you get an extra person.) If they're gonna make us round, it should be at the end, not in every step.
"my mathematical brain hates that I need to round this"
It isn't rounding, casting to int chops the decimal bit off.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
It should hates to use an iterative method when it exists an explicit formula too :p
Yes I agree I don't like rounding, so I did a an unethical workaround.
But in reality, there is no such thing as 0,3 person. So this 0,3 person can not be expected to grow. Of course 0,3 person should be interpreted more like expected value, with 30% chance of no person and 70% chance of existing. But I understand why the creator could have thought he should not allow partial persons
not bad
in other words, converting percent to decimal.
percent
is given as a whole number, so dividing by 100 gives us the proper fractional value.why percent/100?
is it work for
"abcd", [2,2]
Your code return "a", when it should return "ab" !
That's helpful to understand. It's not just "creative," also deals with the memory better.
Loading more items...