Pergunta de entrevista da empresa Roblox

a priority queue problem with 2 parts