Pergunta de entrevista da empresa Google

Find all the positions of 1’s in a sparse bit array using an iterative solution with O(1) space complexity.