Pergunta de entrevista da empresa TikTok

Implement heap sort. Time and space complexity.