[Community Puzzle] [Solved] How time flies: Not all tests passed




make it a disco light!!!! hahahaha



I've trying to solve this puzzle and I always get the test cases correct but when I submit the code I get a 50% score saying that I failed on validator 3, 4 and 6.

I don't see where my code could fail. Can somebody have a look a help me maybe finding out what could be causing the fail? I did it in Python 3.

import sys
import calendar
from datetime import date

begin = input()
end = input()



D1 = date(y1, m1, d1)
D2 = date(y2, m2, d2)
total = (D2 - D1).days



D1=date(y2, m1, d1)
F=(D2 - D1).days
if F>30 and F<60:


if y>0:
    if y>1:
        s+=' years'
        s+=' year'

if m>0:
    if y>0:
        s+=', '
    if m>1:
        s+=' months'
        s+=' month'

if m>0 or y>0:
    s+=', '
s+='total '
if total==1:
    s+=' day'
    s+=' days'



I must have wasted about 4 hours on this puzzle. I’d rather embrace my condition of hopless n00b who can’t even wrap his head around leap years than waste another hour on it.

There is nothing I dislike more than punishing puzzles that slam the validators in your face after a bunch of useless tests lulling you into a false sense of accomplishment.

I would gladly fail the month difference validation since that notion has no clear definition and the OP didn’t bother to explain what he meant by that or provide meaningful tests that could have helped guessing.
I did try a few different methods. 30 days average, count of elapsed months, taking the day of the month into account or not… 4 methods passed the tests, none passed the validation.

Why a validator that supposedly checks only the number of days between two dates would turn down my code will remain forever a sweet mystery to me, but I guess i can live with that.


Is this puzzle really an easy one? Its success rate is currently 49%. Quite a number of Codingamers expressed that all unit tests passed, whereas some evaluation tests failed. Plus, the specification is quite ambiguous (should you write 1 day or 1 days?)

It would be nice that someone audits some submissions that pass all unit tests and fail some evaluation tests. This could let add some unit tests and/or clarifiy the specification.


Same problem here - validators 3,4,6. Is there any example of dates that they may be checking?


Yep, you got it wrong but the tests are not telling it.
You measure year difference by substracting the year which is very wrong.
Between the 31.12.2015 and the 01.0.2016 there’s one day for instance, but you would output 1 year, 1 day.

I added test cases and validators and update existing ones.