Search Insert Position
@der you are right
@qeatzy Proof of correctness please ?
Sorry I am a newbie at algorithms. I cannot understand why you assign nums.length to high instead of nums.length - 1.
It's far less intuitive looking than other answers, and I'd be pissed if I came across this in production code. ouchxp is probably the best as far as clean informative code.
Nice idea NA, nice code. Thank you
because this step considered conditions like target<A or target>A[n-1]
No one has replied
Thank you, I find where I was wrong.
You can get rid of the if(nums.size() == 0 ) check
Thank you so much! I definitely lost several cases in those if-statement without noticing it. Now it worked
Disabled Categories are greyed out
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.