MATL, 6 bytes
toYs~)
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