from typing import List


def gen_string(i: int, base: int, digits: List[str]):
    """Returns a string representation of an integer given the list of digits.

    Args:
        i (int): The integer to generate
        base (int): The base representation of the number. (based on the length of the list)
        digits (int): The list of digits to use.
    """
    num_string = ""
    while i > 0:
        # Prepend the digit
        num_string = digits[i % base] + num_string
        # Effectively right shifting the number (dividing by the base)
        i //= base

    return num_string