Dorm Room Availability Check
Bill and Bob have recently joined the Codefinity University for Cool Engineers. They are now moving into a dormitory and want to share the same room. The dormitory has n rooms in total. Each room has a current occupancy and a maximum capacity. Your task is to determine how many rooms have enough space for both Bill and Bob to move in.
Given a list of n sublists, where each sublist contains two integers c (number of people currently living in the room) and m (room's maximum capacity), return the number of rooms where Bill and Bob can move in together.
Example 1
Input:
[[2, 2], [1, 10], [3, 5], [0, 2]]
Output:
3
main.cpp
C++
Pregunte a AI
Pregunte a AI
Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla