classSolution:defsearchRange(self, nums: List[int], target:int)-> List[int]:ifnot nums:return[-1,-1]defsearchLeft(nums, target):
left =0
right =len(nums)-1while left < right:
mid =(left + right)//2if nums[mid]>= target:
right = mid
else:
left =mid +1if nums[left]!= target:return-1return left
defsearchRight(nums, target):
left =0
right =len(nums)-1while left < right:
mid =(left + right +1)//2if nums[mid]<= target:
left = mid
else:
right = mid -1if nums[right]!= target:return-1return right
left = searchLeft(nums, target)
right = searchRight(nums, target)return[left, right]