Skip to main content
added 7 characters in body
Source Link
movatica
  • 1.4k
  • 7
  • 8

Python 3, 68 6464 62 bytes

lambda L:L[:1]+[L[i]for[L[i]for i in range(1,len(L))if L[i]>=max(L[:1]+L[:i])]

Try it online!Try it online!

Python 3, 68 64 bytes

lambda L:L[:1]+[L[i]for i in range(1,len(L))if L[i]>=max(L[:i])]

Try it online!

Python 3, 68 64 62 bytes

lambda L:[L[i]for i in range(len(L))if L[i]>=max(L[:1]+L[:i])]

Try it online!

added 5 characters in body
Source Link
movatica
  • 1.4k
  • 7
  • 8

Python 3, 6868 64 bytes

f=lambdalambda L:[L[0]]+[L[i]forL[:1]+[L[i]for i in range(1,len(L))if L[i]>=max(L[:i])] 

Try it online!Try it online!

Python 3, 68 bytes

f=lambda L:[L[0]]+[L[i]for i in range(1,len(L))if L[i]>=max(L[:i])] 

Try it online!

Python 3, 68 64 bytes

lambda L:L[:1]+[L[i]for i in range(1,len(L))if L[i]>=max(L[:i])]

Try it online!

Source Link
movatica
  • 1.4k
  • 7
  • 8

Python 3, 68 bytes

f=lambda L:[L[0]]+[L[i]for i in range(1,len(L))if L[i]>=max(L[:i])] 

Try it online!