Cupcakes are baked in batches of K; groups of customers arrive and each group must be fully served before the next. Find the optimal order of groups to maximize the number of groups who get only fresh cupcakes (no leftovers from a previous batch).
Asked in the online assessment stage.
Implement def maximize_fresh_groups(groups, k):, where groups is a list of positive group sizes and k is the batch size. Return the maximum number of groups that begin service with no leftover cupcakes. The order of groups may be rearranged.
def maximize_fresh_groups(groups, k):