class Solution:

    def searchRange(self, nums: List[int], target: int) ->List[int]:
        if not nums:
            return [-1, -1]
        n = len(nums)
        first = bisect.bisect_left(nums, target)
        second = bisect.bisect_right(nums, target) - 1
        if first > n - 1 or second > n - 1 or nums[first] != target or nums[
            second] != target:
            return [-1, -1]
        return [first, second]

e70d0ec2d3fda720a7da621bb43a3dc661a1ea7e
<mask token>

class Solution:
    <mask token>

class Solution:

    def searchRange(self, nums: List[int], target: int) ->List[int]:
        if not nums:
            return [-1, -1]
        n = len(nums)
        first = bisect.bisect_left(nums, target)
        second = bisect.bisect_right(nums, target) - 1
        if first > n - 1 or second > n - 1 or nums[first] != target or nums[
            second] != target:
            return [-1, -1]
        return [first, second]
