\$\begingroup\$I see the Python answer is using an input as the number of days since 1957-12-31 and the JavaScript answer is taking an input in the format yyyyMM without the dd. Are these both allowed according to the "in any reasonable format"? Both would save bytes in my answer as well.\$\endgroup\$
– Kevin CruijssenJan 31 at 12:35

10

\$\begingroup\$I feel like in any reasonable format is not objective enough...\$\endgroup\$
– Luis MendoJan 31 at 13:19

1

\$\begingroup\$@LuisMendo I think it's OK. It just has to uniquely specify the day. Are you worried there is some possible loophole?\$\endgroup\$
– AnushJan 31 at 14:31

3

\$\begingroup\$@Anush The problem is how to tell if a format qualifies as "reasonable" or not. For instance, I wouldn't have guessed that Number of days since some epoch (or even months?) does. So a clearer specification is needed\$\endgroup\$
– Luis MendoJan 31 at 15:58

2

\$\begingroup\$@LuisMendo I have clarified the input format.\$\endgroup\$
– Robin RyderJan 31 at 17:09

\$\begingroup\$I have clarified what counts as a reasonable input format for dates; number of days since an epoch is allowed but not number of months. Your input format was creative! But it was a loophole, which I have now closed. Your previous version based on number of days would be fine.\$\endgroup\$
– Robin RyderJan 31 at 19:31

3

\$\begingroup\$since JavaScript can't compete with many other golfing languages I wanted to at least be creative. :)\$\endgroup\$
– Fabrizio CalderanJan 31 at 19:39

\$\begingroup\$The most impressive part about this answer is that you thought about using floats as input-format so the compressed integers can all be much shorter. :D\$\endgroup\$
– Kevin CruijssenJan 31 at 13:43

3

\$\begingroup\$@KevinCruijssen I actually took this idea from the JS answer. I added credit to my answer.\$\endgroup\$
– GrimmyJan 31 at 13:45

•AÂʒë.š¡ε%ž·7í• # Push compressed integer 813218926689775697373196902446
ŽL} # Push compressed integer 5480
в # Convert the larger integer to base-5480 as list:
# [5479,2922,1826,3287,3408,975,2373,2406]
.¥ # Undelta it with leading 0:
# [0,5479,8401,10227,13514,16922,17897,20270,22676]
› # Check for each if it's larger than the (implicit) input-integer
O # Take the sum to get the amount of truthy values
•=γ1sæΔ• # Push compressed integer 122116126451824
₆в # Convert it to base-36 as list:
# [1,7,10,11,13,16,26,28,29,28]
sè # Swap to get the sum, and use it to index into this list
< # And decrease it by 1
# (since a compressed integer/list cannot contain a leading 0)
# (after which the result is output implicitly)
¨¨ # Remove the last two digits from the (implicit) input (the "dd")
•a3|}\§λ’Iœg½þ• # Push compressed integer 2722385715080006519908031109868
ŽOΩ # Push compressed integer 6203
в # Convert the larger integer to base-6203 as list:
# [1,1501,2301,2801,3701,4605,4901,5507,6202]
•32Ø• # Push compressed integer 195800
+ # Add it to each value in the list:
# [195801,197301,198101,198601,199501,200405,200701,201307,202002]
@ # Check for each if it's larger than or equal to the input minus "dd"
O•=γ1sæΔ•₆вsè< # Same as above

Try it online! Link is to verbose version of code. Takes input as YYYYMMDD. Explanation:

”...” Compressed string of YYYYMM values
⪪ ⁶ Split into substrings of length 6
ＬΦ ‹ιθ Count those that appear before the input
§ &)*,/9;<; Look the count up in a translation table
Ｉ⌕γ Subtract 32 from the ASCII code

\$\begingroup\$Hey @Grimmy, that's well smart and different enough for you to post as your own answer. Fine by me. Same priciple, much cooler solution. I'll certainly upvote.\$\endgroup\$
– ElPedroJan 31 at 21:52

Your Answer

If this is an answer to a challenge…

…Be sure to follow the challenge specification. However, please refrain from exploiting obvious loopholes. Answers abusing any of the standard loopholes are considered invalid. If you think a specification is unclear or underspecified, comment on the question instead.

…Try to optimize your score. For instance, answers to code-golf challenges should attempt to be as short as possible. You can always include a readable version of the code in addition to the competitive one.
Explanations of your answer make it more interesting to read and are very much encouraged.

…Include a short header which indicates the language(s) of your code and its score, as defined by the challenge.

More generally…

…Please make sure to answer the question and provide sufficient detail.

…Avoid asking for help, clarification or responding to other answers (use comments instead).

Code Golf Stack Exchange is a site for recreational programming competitions, not general programming questions. Challenges must have an objective scoring criterion, and it is highly recommended to first post proposed challenges in the Sandbox.