Skip to main content
2 of 2
Commonmark migration

Java, 82 bytes

void f(int[]a){int m=a[0];for(int n:a){System.out.print(m>n?"":n+" ");m=n>m?n:m;}}

Here's a simple output loop. It just keeps the max in m and compares each element.

Geobits
  • 19.7k
  • 4
  • 55
  • 125