Microsoft Interview Question

A algorithm problem with O(1) space.