Expedia Group Interview Question

Complexity of Sort