New answers tagged

1

PowerShell, 25 bytes port of Neil's solution $args-match'[6-9].(..)?$' Try it online! Accepts input from 0 to 239999 and outputs $null for times and the input for non-times.


0

PowerShell, 40 bytes param($n)($n%100-lt60)-and($n%1e4-lt6e3) Try it online!


6

MATL, 45 43 bytes Thanks to Jonathan Allan for pointing out a mistake, now corrected. j':1?'0YXU2e"@Y:wXHx2e"H@Y:g3$YO]]vtf-FT#XM Try it online! Or verify all test cases. How it works j % Input as (unevaluated) string ':1?' % Push this string. Will be interpreted as regexp 0 % Push 0. Will be interpreted as character 0 (...


6

JavaScript (ES6), 122 bytes Thanks to @tsh for a bug fix and some optimizations o=>(D=k=1,M=g=(o,c)=>Object.keys(o).map(c))(o,y=>g(Y=o[y],m=>g(Y[m],d=>M>(D-(D=Date.UTC(y,m-1,d))<-1e8?k=1:++k)?0:M=k)))|M Try it online! Commented o => ( // o = input object D = // D = previous day, as an integer k ...


17

Python 2,  186 184 179 177 173 172  162 bytes -10 thanks to ovs! (avoiding use of .items) x=input() from datetime import* a=sorted(date(y,m,d)for y in x for m in x[y]for d in x[y][m]) print max(map(len,`[d+timedelta(1)in a for d in a*2]`.split('s')))/6 Try it online! Or see the test-suite. Huh, how? In Python 2 input implicitly attempts an eval on the ...


1

Zsh, 13 bytes `date`(): Sun Try it online! date: get the date in the format Sun 28 Mar 07:55:54 BST 2021 ``(): get the output of that and define a function according to each of the words in the output :: do nothing Sun: call the function if the date didn't include Sun, this will fail with command not found: Sun


1

PowerShell, 294 bytes, ~-353 score, +3.5 bonus function J($s){if($s.length-ne8){"E";exit};iex ('$Y_0,4));$M_4,2));$D_6,2))'-replace'_','=[int]($s.substring(');$B=($M-14)/12;if($m-notin1..12){'E';exit};$A=$Y+4800;($J=1461*($A+$B)/4+367*($M-2-12*$B)/12-(3*(($A+$B+100)/100))/4+$D-32075)};[math]::truncate((J("$($args[0])"))-(J("$($args[...


0

Deadfish~, 10529 bytes {iiiii}dcdcicdciiicdddcicdcic{dddd}ic{iiii}dcdcicdciiiiiicddddddcicdcic{dddd}ic{iiii}icdddcicdciiiiicdddddcicdciiic{dddd}dc{iiii}iiiiic{d}iiicicdcccicdc{i}dddc{dddd}dddddc{iiiii}dddc{d}icicdciiiiiicddddddcicdc{i}dc{ddddd}iiic{iiii}dcccdcicdciccc{dddd}ic{iiii}dcccdciicddciccc{dddd}ic{iiii}dcccdciiiiicdddddciccc{dddd}ic{iiii}dcccdc{i}...


Top 50 recent answers are included