```
enter code hereclass Solution(object):
def searchInsert(self, nums, target):
"""
:type nums: List[int]
:type target: int
:rtype: int
"""
if target<nums[0]:
return 0
if target>nums[len(nums)-1]:
return len(nums)
s=0
t=len(nums)-1
while s<t:
mid=s+(t-s)//2
if nums[mid]<target:
s=mid+1
else:
t=mid
return s
```