<s>[INST] class Solution:
    def searchRange(self, nums: List[int], target: int) -> List[int]:
        def findFirst(nums, target):
            l, r = 0, len(nums) - 1
            first_pos = -1
            while l <= r:
                mid = l + (r - l) // 2
                if nums[mid] < target:
                    l = mid + 1
                else:
                    r = mid - 1
                    first_pos = mid
            return first_pos

        def findLast(nums, target):
            l, r = 0, len(nums) - 1
            last_pos = -1
            while l <= r:
                mid = l + (r - l) // 2
                if nums[mid] > target:
                    r = mid - 1
                else:
                    l = mid + 1
                    last_pos = mid
            return last_pos

        return [findFirst(nums, target), findLast(nums, target)][/INST]