EquiLeader solution, uses O(1) space