Pergunta de entrevista da empresa Scantron

Sort array of 0's and 1's in a single traversal