```
def searchInsert(self, nums)
"""
:type nums: List[int]
:type target: int
:rtype: int
"""
max_val = 0
min_val = len(nums)
mid_point = (max_val + min_val) // 2
if target == nums[mid_point]:
return mid_point
if len(nums) < 2:
if target < nums[mid_point]:
return mid_point
else:
return mid_point + 1
if target > nums[mid_point]:
return mid_point + self.searchInsert(nums[mid_point:],target)
else:
return self.searchInsert(nums[:mid_point],target)
```