min with O(1)