Find odd-frequency element with O(1) space | Amazon Interview Question