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

MATL, 29 bytes

24:q60:qt&Z*t!si=Y)'%i:'8:)&V

Try it online!

###Explanation

Explanation

24:q % Push [0 1 ... 23]
60:q % Push [0 1 ... 59]
t % Duplicate
&Z* % Cartesian product of the three arrays. This gives a matrix with each
 % on a different row Cartesian tuple
t! % Push a transposed copy
s % Sum of each column
i= % Logical mask of values that equal the input
Y) % Select rows based on that mask
'%i:' % Push this string
8:) % Index (modularly) with [1 2 ... 8]: gives string '%i:%i:%i'
&V % Convert to string with that format specification. Implicitly display

MATL, 29 bytes

24:q60:qt&Z*t!si=Y)'%i:'8:)&V

Try it online!

###Explanation

24:q % Push [0 1 ... 23]
60:q % Push [0 1 ... 59]
t % Duplicate
&Z* % Cartesian product of the three arrays. This gives a matrix with each
 % on a different row Cartesian tuple
t! % Push a transposed copy
s % Sum of each column
i= % Logical mask of values that equal the input
Y) % Select rows based on that mask
'%i:' % Push this string
8:) % Index (modularly) with [1 2 ... 8]: gives string '%i:%i:%i'
&V % Convert to string with that format specification. Implicitly display

MATL, 29 bytes

24:q60:qt&Z*t!si=Y)'%i:'8:)&V

Try it online!

Explanation

24:q % Push [0 1 ... 23]
60:q % Push [0 1 ... 59]
t % Duplicate
&Z* % Cartesian product of the three arrays. This gives a matrix with each
 % on a different row Cartesian tuple
t! % Push a transposed copy
s % Sum of each column
i= % Logical mask of values that equal the input
Y) % Select rows based on that mask
'%i:' % Push this string
8:) % Index (modularly) with [1 2 ... 8]: gives string '%i:%i:%i'
&V % Convert to string with that format specification. Implicitly display
added 649 characters in body
Source Link
Luis Mendo
  • 106.7k
  • 10
  • 139
  • 382

MATL, 29 bytes

24:q60:qt&Z*t!si=Y)'%i:'8:)&V

Try it online!

###Explanation

24:q % Push [0 1 ... 23]
60:q % Push [0 1 ... 59]
t % Duplicate
&Z* % Cartesian product of the three arrays. This gives a matrix with each
 % on a different row Cartesian tuple
t! % Push a transposed copy
s % Sum of each column
i= % Logical mask of values that equal the input
Y) % Select rows based on that mask
'%i:' % Push this string
8:) % Index (modularly) with [1 2 ... 8]: gives string '%i:%i:%i'
&V % Convert to string with that format specification. Implicitly display

MATL, 29 bytes

24:q60:qt&Z*t!si=Y)'%i:'8:)&V

Try it online!

MATL, 29 bytes

24:q60:qt&Z*t!si=Y)'%i:'8:)&V

Try it online!

###Explanation

24:q % Push [0 1 ... 23]
60:q % Push [0 1 ... 59]
t % Duplicate
&Z* % Cartesian product of the three arrays. This gives a matrix with each
 % on a different row Cartesian tuple
t! % Push a transposed copy
s % Sum of each column
i= % Logical mask of values that equal the input
Y) % Select rows based on that mask
'%i:' % Push this string
8:) % Index (modularly) with [1 2 ... 8]: gives string '%i:%i:%i'
&V % Convert to string with that format specification. Implicitly display
Source Link
Luis Mendo
  • 106.7k
  • 10
  • 139
  • 382

MATL, 29 bytes

24:q60:qt&Z*t!si=Y)'%i:'8:)&V

Try it online!

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