Tripadvisor Interview Question

NP complete problem