Applied Intuition interview question

Sorting based coding algorithm problem related to AV stack