My approch
counter to what we can see, this problem was not a knapsack you want the maximum house to buy so the more the house is cheap the more you can buy max number of house So what i did here is to just sort the list and count the number of house we have until the money limit exceeds