mid hard O(1) space