def build_suffix_array_naive(source: str) -> list[int]:
    """
    A naive, slow suffix-array construction algorithm.
    Construct a list of suffixes of the source string, then calculate the start
    offset of each suffix, storing them in sorted order into the suffix array.

    Runtime: O(n log n)
    """
    n = len(source)
    suffixes = sorted(source[offset:] for offset in range(n + 1))
    return [n - len(suffix) for suffix in suffixes]