Question d’entretien chez TikTok

Implement heap sort. Time and space complexity.