Pergunta de entrevista da empresa Atlassian

something that could’ve been done with basic array/hashmap but interviewer wanted me to use heaps and reduce the time complexity