Approach hintTry it first, then revealHide
Sort service times in increasing order and keep the total waiting time so far. Serve a person only if that total does not exceed their time; anyone else is moved to the end, where they are disappointed anyway.