Skip to main content
[Edit removed during grace period]
Source Link
ElPedro
  • 6.5k
  • 2
  • 26
  • 39
[Edit removed during grace period]
Source Link
ElPedro
  • 6.5k
  • 2
  • 26
  • 39
added 85 characters in body
Source Link
ElPedro
  • 6.5k
  • 2
  • 26
  • 39

Python 2, 59 5757 51 bytes

s=[] for x in input():s+=[x];s=s[:s=(Nones+[x],s[:-21])[x<1]][x<1] print s 

Try it online!Try it online!

Python 2, 59 57 bytes

s=[] for x in input():s+=[x];s=s[:(None,-2)[x<1]] print s 

Try it online!

Python 2, 59 57 51 bytes

s=[] for x in input():s=(s+[x],s[:-1])[x<1] print s 

Try it online!

Source Link
ElPedro
  • 6.5k
  • 2
  • 26
  • 39
Loading