One more point!
For the simple approach... I didn't incorporate the condition
"0s only move rightward; 1s move leftward."
It is always better to discard a condition and try to optimize! This will make your analysis free from constraints!
Finally you can incorporate it the condition when you get a clear idea!
For me, dropping the constraint helps to "see" that "The best solution should involve minimum moves"
After deciding this, the constraint helps me to "see" move should alternate except at the centre....
Regards,
Prunthaban
