Shared my Python code


  • 0

    class Solution:
    def searchInsert(self, nums, target):
    """
    :type nums: List[int]
    :type target: int
    :rtype: int
    """
    output = len(nums);
    for arr in range(len(nums)):
    if nums[arr]>=target:
    output = arr
    break;
    return output


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.