Ad
  • Custom User Avatar

    Hi,

    In the tests floats are rounded to 6 decimals, and tested with a delta of [-0.000001..+0.000001].
    I woill add a comment to the description.

    thanks

  • Custom User Avatar

    you're right, I'll add some more tests
    and rewrite my solution
    thanks

  • Custom User Avatar

    Right thanks :)
    fixed it now and learned something new in python

  • Custom User Avatar

    fixed it.
    thanks

  • Custom User Avatar

    This was for a negative input.
    I rephrased it a little bit.
    Thanks for your input.

  • Custom User Avatar

    thanks for the response; will try to add some soon

  • Custom User Avatar

    I'll try put some effort in it soon.
    Any favorites from your side?

    I was planning on Python, Elixir, Kotlin, JavaScript and maybe some C.

  • Custom User Avatar

    thanks for your reply, Andrew
    I added an extra line in the rules for this

  • Custom User Avatar

    You're absolutely right, (I messed up the numbers myself)
    Should be better now

    thanks

  • Custom User Avatar

    I extended the initial example in the kata with the same explanation to clarify.

    thanks

  • Custom User Avatar

    Hi,

    Those details are described in the rules.
    The crucial part is following:
    The demand is filled in the same sequence as set in the challenge (from left to right), the supply is used up from lowest price to highest.
    The capacity of the supplier with the lowest price is used up for all demands, before the next is consumed.

    Let's say you set a price of 19.19.
    In the example this means first 2000 pieces are consumed from supplier with price 16.00.

    After fulfilling supplier 1, following demand is remaining:
    [ [100, 23.10], [888, 19.19], [3000, 11.8] ]

    This is all consumed from the second supplier who has a capacity of 5000.

    So if your price is 19.19 then no demand is left to fullfull.

    Also the way you calculate your revenue is wrong.
    It is the amount of your capacity sold for the price you set.
    For 16.99 your revenue is 500 * 16.99 because all can be sold in that case.
    For 19.19 your revenue is 0 * 19.19 because nobody want to buy from you.

    Does that help?

  • Custom User Avatar

    you're right
    I will remove it

  • Custom User Avatar

    ok thanks, this is fixed

  • Custom User Avatar

    you're right, is fixed now thanks

  • Custom User Avatar

    Hi,

    Ok thanks
    I'll add some addititional random tests.

  • Loading more items...