The old algorithm during filtering will check every room if it's part of the group. O(N*G) The room ids for a group are now stored in a map for faster lookup so the search can be completed in a single pass. O(N)