Challenge 📝
Given is a number max
representing the maximum number of groups in the queue. You also have an array visitors
of people, where 'X' stands for one person and 'O' for one companion. A group is minimum one 'O' and any number of 'X'. Check if all groups fit into the queue. Return 'full' if all fit. Otherwise, return the number of groups that are too many or not full.
Examples:
cinemaQueue(6, ['X','O','X','O','O','X','X','X','O','X']) => 'full'
cinemaQueue(6, ['X','O','X','O','O','X','X','X','O','X','X','X']) => 'too much: 2'
cinemaQueue(4, ['X','O','X']) => 'not full: 2'