from typing import List


def generateBasisIndexList(basisStrList: List[str], sysLevel: int) -> List[int]:
    """
    Return a list of integers which indicates the basis indices according to the input basis string list.
    For example, ``generateBasisIndexList(['00', '01', '10', '11'], 3)`` will return:
    ``[0, 1, 3, 4]``

    :param basisStrList: basis string list
    :param sysLevel: the energy level of qubits in the system.
    :return: basis indices list
    """
    strLen = [len(item) for item in basisStrList]
    assert max(strLen) == min(strLen), "All input digital strings should have same length."
    digLen = max(strLen)

    def translateStrToInt(strN: str) -> int:
        """ Translate a string to int """
        intNum = 0
        for digIndex, charN in enumerate(strN):
            dig = int(charN)
            assert dig < sysLevel, f"Digit '{dig}' is greater than sysLevel '{sysLevel}'."
            intNum += (sysLevel ** (digLen - digIndex - 1)) * dig
        return intNum

    basisIntList = []
    for strNum in basisStrList:
        basisIntList.append(translateStrToInt(strNum))

    return basisIntList