โ back to unit
Easy
# queues easy
The Bus With Eight Seats
One bus, cap seats, one long line โ how many trips until everyone's at the museum? ๐
You get the line of kids and the bus capacity cap. Print the number of trips needed (the last trip may run partly empty).
Example:
Input: line = ["a","b","c","d","e","f","g","h","i"], cap = 4
Output: 3
Trip 1 boards 4 kids, trip 2 boards 4 more, trip 3 boards the last 1 โ 3 trips in total.
๐ก need a hint?
q-bus-eight-seats.py๐ given lines are locked โ write your code in between
loading...