Visiting Circus
Groups of schoolchildren wants to visit Circus after their lessons. Each group consists of a certain number of children (between 1 and 4), and all children in a group must travel together in the same taxi. Each taxi can hold up to four passengers, and multiple groups can share a taxi as long as the capacity allows. Find the minimum number of taxis needed to transport all the children without splitting any group.
Example 1
Input:
[1, 2, 4, 3, 3]
Output:
4
main.cpp
C++
Fråga AI
Fråga AI
Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal