Last Person to Fit in the Elevator(LeetCode 1204):

Problem