Microsoft interview question

A algorithm problem with O(1) space.