from typing import List


def generateHistogram(table: List[tuple[str, str, int]]) -> str:
    """Generates a simple horizontal histogram string."""
    # Config
    barLength = 50  # Length of each histogram bars

    labelLength = max(len(label) for _, label, _ in table) + 1  # Max Label Size + 1
    maxCohortValue = max(value for _, _, value in table)  # Used to scale values

    histogram = ""  # Histogram output

    # Helpers
    padLabel = lambda label: label + " " * (labelLength - len(label))
    generateBar = lambda value: "#" * int((value / maxCohortValue) * barLength)

    for _, label, value in table:
        histogram += f"{padLabel(label)} | {generateBar(value)}\n"

    return histogram