•AÂʒë.š¡ε%ž·7핎L}в.¥›O•=γ1sæΔ•₆вsè<
Input as number of days since 1957-12-31 (so 1957-12-30 is day -1
; 1957-12-31 is day 0
; 1958-01-01 is day 1
; etc.)
Try it online or verify some more test cases.
Old 42 bytes answer taking input in the format yyyyMMdd
:
¨¨•a3|}\§λ’Iœg½þ•ŽOΩв•32Ø•+@O•=γ1sæΔ•₆вsè<
Try it online or verify some more test cases.
•a3|}\§λ’Iœg½þ•ŽOΩв•32Ø•+
can alternatively be •Me1εä~.=ΔΩ»•Ž5ãв.¥•32Ù•+
for the same byte-count: Try it online or verify some more test cases.
Explanation:
•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
See this 05AB1E tip of mine (sections How to compress large integers? and How to compress integer lists?) to understand how the compression works.
1957-12-31
and the JavaScript answer is taking an input in the formatyyyyMM
without thedd
. Are these both allowed according to the "in any reasonable format"? Both would save bytes in my answer as well. \$\endgroup\$