题解 | #二分查找-II#
二分查找-II
http://www.nowcoder.com/practice/4f470d1d3b734f8aaf2afb014185b395
class Solution:
def search(self , nums , target ):
if target in nums:
for i in range(len(nums)):
if nums[i] == target:
return i
else:
return -1