Explain how you would process inventory-like data from a list and produce the required outputs in a reasonable way.
Implement inventory_totals(records). Each record is a two-element list [item, quantity], where quantities may be positive or negative adjustments. Return a list of [item, total_quantity] pairs, with one pair per distinct item, sorted alphabetically by item. Return an empty list when no records are provided.
def inventory_totals(records):