C++20 sections · 1024 units
Open in Course

Problem - George and Accommodation

Room availability

George and Alex need a room. You're given nn rooms, each with a current occupancy and a capacity. They need at least 22 free beds in the same room to be comfortable. Your task: count how many rooms can accommodate both of them.

This tests your understanding of processing paired values and applying simple conditions. Before reading on, think: if a room has 33 people and capacity 66, can they stay there? What about a room with 55 people and capacity 66?