Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.
classSolution(object):defsearchInsert(self,nums,target):""" :type nums: List[int] :type target: int :rtype: int """ifnotnums:return0ifnums[0]>=target:return0foriinrange(1,len(nums)):ifnums[i]==target:returniiftarget<nums[i]:returnireturnlen(nums)