Instead of return -1 and index, we just need to output left since the left pointer always point to the first index which not less than target. However, I do not know the mechanism behind it. Magic.
leetcode-35-Search Insert Position
最新推荐文章于 2019-05-31 00:39:10 发布