def gen_bwt_array(s: str, suf_tab: list[int]) -> list[str]:
    """
    computes bwt array using suf_tab
    :param s: text for which bwt array is being computed
    :param suf_tab: suffix array for the input text
    :return: a bwt array for text
    """
    s += '$'
    bwt_array: list[str] = []

    for suf in suf_tab:
        bwt_array.append(s[suf - 1])

    return bwt_array