from typing import List


def search_range_back(nums: List[int], target: int) -> List[int]:
    """
    :param nums:
    :param target:
    :return:
    >>> search_range_back([5,7,7,8,8,10], 8)
    [3, 4]
    >>> search_range_back([5,7,7,8,8,10], 6)
    [-1, -1]
    >>> search_range_back([5,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,8,8,10], 8)
    [24, 25]
    """
    if not nums:
        return [-1, -1]
    left: int = 0
    len_nums: int = len(nums)
    right: int = len_nums - 1
    while left <= right:
        mid: int = (left + right) // 2
        if nums[mid] > target:
            while mid > left and nums[mid - 1] == nums[mid]:
                mid -= 1
            right = mid - 1
        elif nums[mid] < target:
            while mid < right and nums[mid + 1] == nums[mid]:
                mid += 1
            left = mid + 1
        else:
            mid_left: int = mid
            while mid_left > left:
                if nums[mid_left - 1] == nums[mid_left]:
                    mid_left -= 1
                else:
                    break
            mid_right: int = mid
            while mid_right < right:
                if nums[mid_right + 1] == nums[mid_right]:
                    mid_right += 1
                else:
                    break
            return [mid_left, mid_right]
    return [-1, -1]