Given an array of appointment times and a range k, return the max amount of appointments in that k range.
Asked in the OA / coding round stage. For this task, a valid range may contain times whose difference between the maximum and minimum is at most k + 1. Return the largest number of appointments in any such range.
Implement max_appointments(times, k), where times is a list of integers and k is a non-negative integer. Return an integer.
def max_appointments(times, k):