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++
Pergunte à IA
Pergunte à IA
Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo