Expedia Group interview question

Complexity of Sort