working with logical vectors

The different steps of the previous exercise (calculate cumsum, create logical vector, sum the number of persons that can enter the elevator)
can be combined in one single step.
Complete the provided code.