class Solution(object):
def searchInsert(self, nums, target):
"""
:type nums: List[int]
:type target: int
:rtype: int
"""
for i in range(len(nums)):
if nums[i]==target:
return i
if nums[i]>target:
return i
return len(nums)
网友评论