Airbnb Senior Software Engineer TPS Interview Question
Question Details
Helping the Leetcode Community! ``` For a given neighborhood and group size G, choose a subset of properties such that: - Total capacity >= Group_size - Among all such subsets, choose the one with min
Full Details
Helping the Leetcode Community! For a given neighborhood and group size G, choose a subset of properties such that: - Total capacity >= Group_size - Among all such subsets, choose the one with minimum number of properties - If multiple subsets use the same number of properties, choose the one with minimum total capacity - Return the selected property IDs - If impossible, return -1 Sample Input: function(List<Property> properties, int group_size, String neighbourHood) -> return type: List<Integer> property_ids Property1 : { Id:1, Capacity: 5, NeighborHood: "downtown" } Property2 : { Id:2, Capacity: 3, NeighborHood: "downtown" } Property3 : { Id:3, Capacity: 1, NeighborHood: "downtown" } Property4 : { Id:4, Capacity: 3, NeighborHood: "uptown" } Property5 : { Id:5, Capacity: 2, NeighborHood: "uptown" }