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

Eliminated unnecessary leading zero
Source Link

APL (Dyalog), 2919 (削除) 29 (削除ここまで) bytes (削除) 1 Bytebyte (削除ここまで) No header (削除) and (削除ここまで) or footer

⊃{⍬≡⍵:,0⋄1=⍴⍵:1,0⋄1⋄(+/2↑⍵),⍵}⍬

Try it on TryAPL.org! Try it on TryAPL.org!

Thanks to Bubbler for pointing out that the header and footer could be incorporated into the function

With a header/footer, the body could be significantly shorter, but that's counter to the metric of success.

APL (Dyalog), 29 bytes (削除) 1 Byte (削除ここまで) No header (削除) and (削除ここまで) or footer

⊃{⍬≡⍵:,0⋄1=⍴⍵:1,0⋄(+/2↑⍵),⍵}⍬

Try it on TryAPL.org!

Thanks to Bubbler for pointing out that the header and footer could be incorporated into the function

With a header/footer, the body could be significantly shorter, but that's counter to the metric of success.

APL (Dyalog), 19 (削除) 29 (削除ここまで) bytes (削除) 1 byte (削除ここまで) No header (削除) and (削除ここまで) or footer

⊃{⍬≡⍵:1⋄(+/2↑⍵),⍵}⍬

Try it on TryAPL.org!

Thanks to Bubbler for pointing out that the header and footer could be incorporated into the function

With a header/footer, the body could be significantly shorter, but that's counter to the metric of success.

Eliminated the header and footer and the naming of the function to maintain the byte count.
Source Link

APL (Dyalog), 29 bytes 1 byte(削除) 1 Byte (削除ここまで) No header and(削除) and (削除ここまで) or footer

{t←⍬≡⍵⍬≡⍵:,0⋄1=⍴⍵:1,0⋄(+/2↑⍵),⍵}

Try it on TryAPL.org! Try it on TryAPL.org!

WithThanks to Bubbler for pointing out that the header ⍬ (an empty vector) and footer ⊃ (right),could be incorporated into the code looks as follows:

⊃{t←⍬≡⍵:,0⋄1=⍴⍵:1,0⋄(+/2↑⍵),⍵}⍬

⊃{t←⍬≡⍵:,0⋄1=⍴⍵:1,0⋄(+/2↑⍵),⍵}{t←⍬≡⍵:,0⋄1=⍴⍵:1,0⋄(+/2↑⍵),⍵}⍬

and so on.function

With a longer header/footer, the body could be significantly shorter, but that's counter to the metric of success.

APL (Dyalog), 29 bytes 1 byte header and footer

{t←⍬≡⍵:,0⋄1=⍴⍵:1,0⋄(+/2↑⍵),⍵}

Try it on TryAPL.org!

With the header ⍬ (an empty vector) and footer ⊃ (right), the code looks as follows:

⊃{t←⍬≡⍵:,0⋄1=⍴⍵:1,0⋄(+/2↑⍵),⍵}⍬

⊃{t←⍬≡⍵:,0⋄1=⍴⍵:1,0⋄(+/2↑⍵),⍵}{t←⍬≡⍵:,0⋄1=⍴⍵:1,0⋄(+/2↑⍵),⍵}⍬

and so on.

With a longer header/footer, the body could be significantly shorter, but that's counter to the metric of success.

APL (Dyalog), 29 bytes (削除) 1 Byte (削除ここまで) No header (削除) and (削除ここまで) or footer

{⍬≡⍵:,0⋄1=⍴⍵:1,0⋄(+/2↑⍵),⍵}

Try it on TryAPL.org!

Thanks to Bubbler for pointing out that the header and footer could be incorporated into the function

With a header/footer, the body could be significantly shorter, but that's counter to the metric of success.

added 118 characters in body
Source Link

APL (Dyalog), 29 bytes 1 byte header and footer

{t←⍬≡⍵:,0⋄1=⍴⍵:1,0⋄(+/2↑⍵),⍵}

Try it on TryAPL.org!

With the header ⍬ (an empty vector) and footer ⊃ (right), the code looks as follows:

⊃{t←⍬≡⍵:,0⋄1=⍴⍵:1,0⋄(+/2↑⍵),⍵}⍬

⊃{t←⍬≡⍵:,0⋄1=⍴⍵:1,0⋄(+/2↑⍵),⍵}{t←⍬≡⍵:,0⋄1=⍴⍵:1,0⋄(+/2↑⍵),⍵}⍬

and so on.

With a longer header/footer, the body could be significantly shorter, but that's counter to the metric of success.

APL (Dyalog), 29 bytes 1 byte header and footer

{t←⍬≡⍵:,0⋄1=⍴⍵:1,0⋄(+/2↑⍵),⍵}

Try it on TryAPL.org!

With the header ⍬ (an empty vector) and footer ⊃ (right), the code looks as follows:

⊃{t←⍬≡⍵:,0⋄1=⍴⍵:1,0⋄(+/2↑⍵),⍵}⍬

⊃{t←⍬≡⍵:,0⋄1=⍴⍵:1,0⋄(+/2↑⍵),⍵}{t←⍬≡⍵:,0⋄1=⍴⍵:1,0⋄(+/2↑⍵),⍵}⍬

and so on.

APL (Dyalog), 29 bytes 1 byte header and footer

{t←⍬≡⍵:,0⋄1=⍴⍵:1,0⋄(+/2↑⍵),⍵}

Try it on TryAPL.org!

With the header ⍬ (an empty vector) and footer ⊃ (right), the code looks as follows:

⊃{t←⍬≡⍵:,0⋄1=⍴⍵:1,0⋄(+/2↑⍵),⍵}⍬

⊃{t←⍬≡⍵:,0⋄1=⍴⍵:1,0⋄(+/2↑⍵),⍵}{t←⍬≡⍵:,0⋄1=⍴⍵:1,0⋄(+/2↑⍵),⍵}⍬

and so on.

With a longer header/footer, the body could be significantly shorter, but that's counter to the metric of success.

Source Link
Loading

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