Python 35ms


  • 0
    V
    class Solution(object):
        def searchInsert(self, nums, target):
            for i in range(len(nums)):
                if nums[i] >= target:
                    return i
            return len(nums)

Log in to reply
 

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