Skip to main content
2 of 5
shortness
peak
  • 145
  • 4

jq (76 bytes)

Since shortness is the goal ...

def f:def i:.,(i|([0]+.,[1]+.));nth(.-1;[1]|i|select(index([1,1])|not))+[1]; 

Example:

65|f #=> [0,1,0,0,1,0,0,0,1,1] 

Try it online

peak
  • 145
  • 4