Ad
  • Default User Avatar

    Take into account: If the savings from choosing B are less than 1 full integer, it's NOT worth it YET to John.

  • Default User Avatar

    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.

  • Default User Avatar

    If the savings from choosing B are less than 1 full integer, it's NOT worth it YET to John

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    you actually never really round, only check "if I rounded now, will it be bigger?"
    but the continue working with un-rounded values

  • Default User Avatar

    Some cases I've gotten into went deep into 10000s of days. Take that into account.

  • Default User Avatar

    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.

  • Default User Avatar
        testing(Movie.movie(835076, 13, 0.97), 64270);
    

    is an edge case which separates people who used doubles and didn't notice and people who tried float and rip out their hair

  • Default User Avatar

    you need to convert to wanted doubles earlier (separate line), then do all the math on doubles.
    then simple int(r) should work

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    Thank you very much, will keep in mind for future cases.

  • Default User Avatar

    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...