Question d’entretien chez Microsoft

find the consective 1s in an array