def check_if_max_percent_reached(df, max_per_stock):
    """
    Checks if any stocks have reached the max % contribution towards the investment_goal.
    If a stock has reached maxiumum contribution, it needs to be seperated because we do not want to invest further into this stock,
    and rather distribute the Investment through the remiaining ones.

    Args:
        df (DataFrame): The DataFrame that should be checked
        max_per_stock (int): The % that a single stock can at most contribute towards the goal

    Returns:
        If a stock has reached max --> Splits the DataFrame in two.
            df_no_max_per (DataFrame) : DataFrame with all stocks that have not yet reached the maximum contribution
            df_max_per (DataFrame) : DataFrame with all stocks that have reached the maximum contribution
        If no stock has reached max --> Returns DataFrame and 0 (to have two outputs)
            df (DataFrame) : Full DataFrame that was passed into the function
            0 (int) : This is passed so the function always has two outputs no matter the outcome.
    """
    a = df[df["% Contribution to Goal"] >= max_per_stock].index.tolist()
    if len(a) == 0:
        return df, 0
    else:
        df_no_max_per = df[~df.index.isin(a)]
        df_max_per = df[df.index.isin(a)]
    return df_no_max_per, df_max_per