LuxuryEscapes Interview Question

Resolve an algorithm to improve performance