Given a list of patient appointment schedules, merge overlapping time slots to find the total busy time for a clinic.
Represent each appointment as a two-element list [start, end], using half-open intervals where start < end. Return the total number of time units covered by at least one appointment. Return 0 for an empty list.
Examples: [[1, 4], [3, 6], [8, 10]] returns 7; [[2, 5], [5, 8]] returns 6.
Function: def total_busy_time(appointments):
def total_busy_time(appointments):