标签:
class Solution: # @param {integer[]} nums # @param {integer} target # @return {integer[]} def searchRange(self, nums, target): if target in nums: result = [] start = nums.index(target) result.append(start) times = nums.count(target) result.append(start+times-1) return result else: return [-1, -1]
Leetcode 34 Search for a Range
标签:
原文地址:http://blog.csdn.net/andrew9tech/article/details/45889891