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.
Take into account: If the savings from choosing B are less than 1 full integer, it's NOT worth it YET to John.
I don't think the examples match the description as I understand it.
The examples count amount of ways you can sum up to the value
but the description I think suggests something else? maybe give "number of valid values of n" some name?
and I had to really stare at the examples to even guess what the solution is meant to do.
It's a good problem, but the description could be longer.
If the savings from choosing B are less than 1 full integer, it's NOT worth it YET to John
This comment is hidden because it contains spoiler information about the solution
you actually never really round, only check "if I rounded now, will it be bigger?"
but the continue working with un-rounded values
Some cases I've gotten into went deep into 10000s of days. Take that into account.
The logic is sound. You're likely bumping into some edge cases where the ticket price falls too low to be properly counted.
Try printing out some logs while running the code, especially initial values.
Changing the decimal values datatype helped me in Java.
Apparently Float is TOO corect for the function this is being tested against.
is an edge case which separates people who used doubles and didn't notice and people who tried float and rip out their hair
you need to convert to wanted doubles earlier (separate line), then do all the math on doubles.
then simple int(r) should work
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 comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Thank you very much, will keep in mind for future cases.
If it wouldn't be too much trouble, I'd like to kindly ask you to please add the missing space in the examples (namely the middle one) or remove spaces from the others, for elegancy and consistency and to please Aspies such as myself.
Loading more items...