class Solution: def searchInsert(self, nums, target): """ :type nums: List[int] :type target: int :rtype: int """ if target in nums: return nums.index(target) else: for i, n in enumerate(nums): if n > target: return i return len(nums)