The execution time may not be perfect but it's easy to read and understand, I think...

```
public class Solution {
public int searchInsert(int[] nums, int target) {
int i=0;
if(nums[0]>=target) return 0;
if(nums[nums.length-1]<target) return nums.length;
while(nums[i]<target&&i<nums.length-1){
i++;
} return i;
}
```

}