Ad
  • Custom User Avatar

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

  • Custom User Avatar
    • description should be reworded, especially the part where each gift is raised to an exponent of two when calculating the score.
    • input type should be different, maybe in the form of a dictionary
    • fixed tests for handling ties
  • Custom User Avatar

    there was a typo in the tests. it's been edited now

  • Custom User Avatar

    i have implemented a checker function in the preloaded set which checks the user's solution. please let me know if there is anything i should add

  • Custom User Avatar

    output type has been changed

  • Custom User Avatar

    in that case, is it better to ask the user to output the final answer without rounding to 4 places and using approx_equals in the tests?

  • Custom User Avatar

    the user function runs with inp first, then reference solution runs with the same input. So user function modifying the input will break the reference solution

    ahh gotcha

    Also, don't forget to re-publish the kata once the issues are fixed ;-)

    i wasnt able to publish it with issues open. its published now

  • Custom User Avatar

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

  • Custom User Avatar

    im not really sure how this works. can you share a resource to read more on this?

  • Custom User Avatar

    Also, reference solution is using epsilon = 0.0001, but in the description it is 0.00001.

    changed this

    Well, that's just 4 decimal places. Significant figures (aka precision) is a completely different thing.

    I guess the text from my university has different semantics for this. I understand the difference now.

    It looks like this only happens some of the time for certain random inputs. It could probably be mitigated by imposing an upper limit on the number of iterations?

    ive put 100 as the upper limit of iterations for now, until i get a better implementation of the solution.

  • Custom User Avatar
    • my bad, i meant 4 significant figures after the decimal place.
    • again, my bad, had a brain fog when checking the number of decimal places to check.
    • rounding intermediate values to a certain number of places is the usual convention when doing this by hand so i thought i needed to include it here. but in my current implementation, not rounding to 4 decimal places in each iteration increases the time complexity by a lot, which is why i left it for now.
  • Custom User Avatar

    fixed

  • Custom User Avatar

    closing

  • Custom User Avatar

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

  • Custom User Avatar

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

  • Loading more items...