def two_sum_hashtable(nums: list[int], target: int) -> list[int]:
    """Determines the two indexes of the elements that together sum to the given `target`

    Complexity:
        n = len(nums)
        Time: O(n)
        Space: O(n) (for hashtable)

    Args:
        nums: sorted array of numbers
        target: value for which we are finding a two sum

    Returns:
        distinct *1-indexed* indices of two numbers that add up to `target`
        where 1 ≤ answer[0] < answer[1] ≤ numbers.length.

    Examples:
        >>> two_sum_hashtable([2,7,11,15], target=9)
        [1, 2]
        >>> two_sum_hashtable([3,2,4], target=6)
        [2, 3]
        >>> two_sum_hashtable([3,3], target=6)
        [1, 2]
        >>> two_sum_hashtable([], target=0)
        Traceback (most recent call last):
        ...
        RuntimeError: Solution assumed to exist but was not found

    """

    """ALGORITHM"""
    ## INITIALIZE VARS ##
    # DS's/res
    nums_idx = {}

    for i, num in enumerate(nums):
        diff = target - num
        if diff in nums_idx:
            return [nums_idx[diff] + 1, i + 1]
        else:
            nums_idx[num] = i

    raise RuntimeError("Solution assumed to exist but was not found")