6 kyu

Christmas Present Calculator

226 of 418zruF
Description
Loading description...
Date Time
Fundamentals
  • Please sign in or sign up to leave a comment.
  • ahmet_popaj Avatar

    Fancy and funny series...

  • vazaio Avatar

    Looks like I faced a bug for JS. Any test case expects "0"

  • Lixfeld Avatar
  • saudiGuy Avatar

    python new test framework is required. updated in this fork

  • FArekkusu Avatar

    The user can modify the input.

  • G_kuldeep Avatar

    Nice series :)

  • dcieslak Avatar

    I think there is some bug in C# version. I didn't have this issue with Javascript's version. The production power is bigger than time needed for 1 present and your Random test returns 0.

    Presents: 16:37:13 Presents to time: 59833
    Prod: 2,1,2,1,1  Prod Total: 604800
    
    Expected: 0
    But was:  1
    
    • zruF Avatar

      Thanks for this information! I made a little mistake in the translation from javascript. It should be fixed now :)

      Issue marked resolved by zruF 8 years ago
    • dcieslak Avatar

      I think there is still some bug. Check if your sorting works. In the below you have: 19:07:16 x 17 times, 08:25:58 x 15 times. 30358 x 5 = 151790. But your Total power is 345600. There is still some elf power left for more presents ;)

      Presents: 19:07:16,19:07:16,19:07:16,19:07:16,19:07:16,19:07:16,19:07:16,19:07:16,19:07:16,19:07:16,19:07:16,19:07:16,19:07:16,19:07:16,19:07:16,19:07:16,19:07:16,08:25:58,08:25:58,08:25:58,08:25:58,08:25:58,08:25:58,08:25:58,08:25:58,08:25:58,08:25:58,08:25:58,08:25:58,08:25:58,08:25:58,08:25:58
      Presents to time: 30358,30358,30358,30358,30358,30358,30358,30358,30358,30358,30358,30358,30358,30358,30358,68836,68836,68836,68836,68836,68836,68836,68836,68836,68836,68836,68836,68836,68836,68836,68836,68836
      Prod: 1,2,1
      Prod Total: 345600
      
      Expected: 5
      But was:  11
      
    • zruF Avatar

      I hope it's fixed now.

    • dcieslak Avatar

      It accepted my C# solution . Thanks!

  • zruF Avatar

    This kata tells me it's awaiting an approval. Someone has to help! :]

  • zruF Avatar

    Python translation added!

  • docgunthrop Avatar

    I recommend adding some further clarification in the kata description (at first it appeared that this kata may have required incorporating aspects of the Knapsack problem).

    Perhaps it could be made clear that work on a given present can be distributed between more than one "elf" (in quotations because I'm including Santa as an elf). Without the detail, it leaves open ambiguity for the fundamental design of a solution.

    Some users may wonder if an elf that doesn't have enough time to work on building any remaining toys loses their remaining productivity or if their time can be allocated to helping another elf on completion of a toy.

    EDIT: to give an example: elf1 has made 4 toys already and has remaining time of half a day. elf2 hasn't made any toys but has the productivity level to make a toy in half a day. Each of the remaining yet-to-be-made toys requires at least 15 hours each. Individually, the two elves cannot build any more toys. If, however, they combine their remaining productivity, they can make 1 additional toy.

    EDIT #2&3: grammar improvement

    • zruF Avatar

      I updated the description and hope "You can count it as one work capacity" clarifies it a bit. Too much description isn't good either ;)

      Suggestion marked resolved by zruF 8 years ago