Expedia Group Interview Question

Describe your approach in the hackerrank