Cody

# Problem 44949. Find the Best Hotels

Solution 3473469

Submitted on 29 Oct 2020
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Fail
hotels =["CityLights";"SeaView";"MarketPlace";"ResortSpa";"Nightingale";"Clubadub";"SkylineView";"MarinaBay";"ComfortFirst";"VillageValley"]; ratings = [7.2;8.7;6.5;9.3;4.3;6.9;8.8;5.9;7.4;9.1]; cutoff = 8; good_correct = ["SeaView";"ResortSpa";"SkylineView";"VillageValley"]; assert(isequal(find_good_hotels(hotels,ratings,cutoff),good_correct))

nRows = 10 nCols = 1 hotels = 10×1 string array "CityLights" "SeaView" "MarketPlace" "ResortSpa" "Nightingale" "Clubadub" "SkylineView" "MarinaBay" "ComfortFirst" "VillageValley" hotels = 10×1 string array "CityLights" "SeaView" "MarketPlace" "ResortSpa" "Nightingale" "Clubadub" "SkylineView" "MarinaBay" "ComfortFirst" "VillageValley" hotels = 10×1 string array "CityLights" "SeaView" "MarketPlace" "ResortSpa" "Nightingale" "Clubadub" "SkylineView" "MarinaBay" "ComfortFirst" "VillageValley" hotels = 10×1 string array "CityLights" "SeaView" "MarketPlace" "ResortSpa" "Nightingale" "Clubadub" "SkylineView" "MarinaBay" "ComfortFirst" "VillageValley"

Assertion failed.

2   Fail
hotels = ["ComfortFirst";"CityLights";"Clubadub";"Nightingale";"MarketPlace";"MarinaBay";"ResortSpa";"VillageValley";"SkylineView";"SeaView"]; ratings = [8.8000;7.2000;9.3000;8.7000;6.9000;7.4000;6.5000;4.3000;5.9000;9.1000]; cutoff = 9; good_correct = ["Clubadub";"SeaView"]; assert(isequal(find_good_hotels(hotels,ratings,cutoff),good_correct))

nRows = 10 nCols = 1 hotels = 10×1 string array "ComfortFirst" "CityLights" "Clubadub" "Nightingale" "MarketPlace" "MarinaBay" "ResortSpa" "VillageValley" "SkylineView" "SeaView" hotels = 10×1 string array "ComfortFirst" "CityLights" "Clubadub" "Nightingale" "MarketPlace" "MarinaBay" "ResortSpa" "VillageValley" "SkylineView" "SeaView"

Assertion failed.

3   Fail
hotels = ["Nightingale";"VillageValley";"SeaView";"CityLights";"ResortSpa";"ComfortFirst";"SkylineView";"Clubadub";"MarinaBay";"MarketPlace"]; ratings = [7.2000;8.7000;6.5000;7.4000;9.3000;9.1000;6.9000;8.8000;5.9000;4.3000]; cutoff = 7; good_correct = ["Nightingale";"VillageValley";"CityLights";"ResortSpa";"ComfortFirst";"Clubadub"]; assert(isequal(find_good_hotels(hotels,ratings,cutoff),good_correct))

nRows = 10 nCols = 1 hotels = 10×1 string array "Nightingale" "VillageValley" "SeaView" "CityLights" "ResortSpa" "ComfortFirst" "SkylineView" "Clubadub" "MarinaBay" "MarketPlace" hotels = 10×1 string array "Nightingale" "VillageValley" "SeaView" "CityLights" "ResortSpa" "ComfortFirst" "SkylineView" "Clubadub" "MarinaBay" "MarketPlace" hotels = 10×1 string array "Nightingale" "VillageValley" "SeaView" "CityLights" "ResortSpa" "ComfortFirst" "SkylineView" "Clubadub" "MarinaBay" "MarketPlace" hotels = 10×1 string array "Nightingale" "VillageValley" "SeaView" "CityLights" "ResortSpa" "ComfortFirst" "SkylineView" "Clubadub" "MarinaBay" "MarketPlace" hotels = 10×1 string array "Nightingale" "VillageValley" "SeaView" "CityLights" "ResortSpa" "ComfortFirst" "SkylineView" "Clubadub" "MarinaBay" "MarketPlace" hotels = 10×1 string array "Nightingale" "VillageValley" "SeaView" "CityLights" "ResortSpa" "ComfortFirst" "SkylineView" "Clubadub" "MarinaBay" "MarketPlace"

Assertion failed.

4   Fail
hotels = ["Nightingale";"VillageValley";"SeaView";"CityLights";"ResortSpa";"ComfortFirst";"SkylineView";"Clubadub";"MarinaBay";"MarketPlace"]; ratings = [7.2000;8.7000;6.5000;7.4000;9.3000;9.1000;6.9000;8.8000;5.9000;4.3000]; cutoff = 7.2000; good_correct = ["Nightingale";"VillageValley";"CityLights";"ResortSpa";"ComfortFirst";"Clubadub"]; assert(isequal(find_good_hotels(hotels,ratings,cutoff),good_correct))

nRows = 10 nCols = 1 hotels = 10×1 string array "Nightingale" "VillageValley" "SeaView" "CityLights" "ResortSpa" "ComfortFirst" "SkylineView" "Clubadub" "MarinaBay" "MarketPlace" hotels = 10×1 string array "Nightingale" "VillageValley" "SeaView" "CityLights" "ResortSpa" "ComfortFirst" "SkylineView" "Clubadub" "MarinaBay" "MarketPlace" hotels = 10×1 string array "Nightingale" "VillageValley" "SeaView" "CityLights" "ResortSpa" "ComfortFirst" "SkylineView" "Clubadub" "MarinaBay" "MarketPlace" hotels = 10×1 string array "Nightingale" "VillageValley" "SeaView" "CityLights" "ResortSpa" "ComfortFirst" "SkylineView" "Clubadub" "MarinaBay" "MarketPlace" hotels = 10×1 string array "Nightingale" "VillageValley" "SeaView" "CityLights" "ResortSpa" "ComfortFirst" "SkylineView" "Clubadub" "MarinaBay" "MarketPlace" hotels = 10×1 string array "Nightingale" "VillageValley" "SeaView" "CityLights" "ResortSpa" "ComfortFirst" "SkylineView" "Clubadub" "MarinaBay" "MarketPlace"

Assertion failed.

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!