[Python] 38ms solution


  • 0
    P

    def search(self, nums, target):
    """
    :type nums: List[int]
    :type target: int
    :rtype: bool
    """
    if target in nums[:len(nums)//2]:
    return True
    elif target in nums[len(nums)//2:]:
    return True
    else:
    return False


Log in to reply
 

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