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 Revisions

4 of 4
Commonmark migration

MATL, 6 bytes

toYs~)

Try it online!

Explanation

t % Input array implicitly. Duplicate
o % Parity of each entry. Gives 0 for even entries, 1 for odd
Ys % Cumulative sum
~ % Logical negate. Gives true for the first run of even entries, and then false
) % Use this as logical index into the original array. Implicitly display
Luis Mendo
  • 106.7k
  • 10
  • 139
  • 382

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