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.
微信扫一扫
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.
相关推荐