o(1) space hard