codewars / content-issues

Higher level issue tracker for the Codewars content.
15 stars 1 forks source link

Deduplicate - Number of days between two dates #192

Open hobovsky opened 1 year ago

hobovsky commented 1 year ago

From #39

  1. Count the number of days between two dates

    • 6 kyu
    • Input is year1, month1, day1, year2, month2, day2. Result can be positive or negative.
    • Satisfaction 86% with 370 completions.
    • 2 pending issues
    • 2 languages + 1 pending translation
    • Published Jun 2017, author inactive.
  2. Day of the Year

    • 7 kyu
    • Input is [d, m, y]. Lower bound is implicit, calculate which day in year is the given date.
    • Satisfaction 92% with 470 completions.
    • No pending issues.
    • 3 languages + 1 pending translation.
    • Published Nov 2017, author inactive.
  3. Age in days

    • 7kyu
    • input is year, month, day. Calculate days between given date in the past and today.
    • Satisfaction 83% with 1200 completions.
    • 2 pending issues.
    • 4 languages + 1 pending translation.
    • Published Oct 2016, author deleted.
  4. Count the days!

    • 6kyu
    • Recognize if the date is in the future/past/today, and calculate diff only for future dates.
    • Satisfaction 83% with 1800+ completions.
    • 1 pending issue
    • 6 languages, no pending translations.
    • Published Nov 2016, author active.
hobovsky commented 1 year ago

I have no idea which kata to keep. Kata 1. is the most generic task, remaining kata are its special cases of some form. Kata 3. and 4. seem to be the closest to each other and 4. has more languages, so at least kata 3. could be retired, but I am not sure about the rest. Each of the kata has also its own set of problems. Each of them has some translations which are highly flawed:

Whichever kata is chosen to stay, it will require some fixing.

All ideas how to handle this set are welcome.

hobovsky commented 1 year ago

One possible idea: retire all, redo from scratch. But then we'd have to decide what the task would exactly be.

Hari3 commented 1 year ago

Just based on numbers, the 4th one seems better the first is the most generic

Reasons to keep

Reasons to retire:

--LFM

armeanco commented 1 year ago

My vote:

  1. Day of the Year
  2. Count the days!
zruF commented 1 year ago

Heyho author of the 4th kata here :) I agree with your suggestion, it would be good to unify them into one complete kata. The kata I created was one of the first I did and there is definitely room for improvement. Unfortunately I don't have the time right now to fix listed issues in multiple languages, but maybe I can find some time for at least the C# and JS translation.

monadius commented 1 year ago

I like 2 the most. One big advantage of 2 is that it can be easily solved without date/time standard functions. I also don't see any issues with 2 (I fixed a COBOL leap year issue).

I dislike 4 the most: The rounding requirement is not properly defined (rounding with respect to minutes, seconds, milliseconds, or something else), not properly tested in some languages (C# at least), and it is not correct in other languages (C: the reference solution truncates the result, Java: the reference solution performs an integer division before rounding). These issues can be fixed but I don't think that this kata is better than 3.

So my vote is to keep 1 or 3 and 2. Among 1 and 3 I would prefer 3 because its rank is 7 kyu and it has more completions and languages.

EloiseRosen commented 1 year ago

Vote to keep 1, retire the others