Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

Commonmark migration
Source Link

#K4 , 40 bytes

K4 , 40 bytes

#K4 , 40 bytes

K4 , 40 bytes

Source Link
mkst
  • 5.3k
  • 13
  • 19

#K4, 40 bytes

Solution:

{+/1<.q.mod[d+!(."."/:|"."\:x)-d:.z.d]7}

Explanation:

Calculate the difference between the dates, use modulo 7 to ignore weekends, sum up.

{+/1<.q.mod[d+!(."."/:|"."\:x)-d:.z.d]7} / the solution
 .q.mod[ ]7 / modulo with 7
 .z.d / UTC date
 d: / save as d
 - / subtract from
 ( ) / do this together
 "."\:x / split input on "."
 | / reverse
 "."/: / join back with "."
 . / take the value
 ! / range 0..the difference
 d+ / add today's date to range
 1< / is 1 less than the modulo (ie is this mon-fri)?
 +/ / sum up

Notes:

  • same byte alternative to the date parsing: "D",ドル/|"."\:x

AltStyle によって変換されたページ (->オリジナル) /