LeetCode-33-Search in Rotated Sorted Array 水题

来源:互联网 发布:mac的caj阅读器 编辑:程序博客网 时间:2024/06/07 07:11

问世间还能有多水的题

class Solution(object):    def search(self, nums, target):        """        :type nums: List[int]        :type target: int        :rtype: int        """        for i in range(len(nums)):            if nums[i]==target:                return i        return -1