LinkedInstaff_plusmar. de 2026
Proposed a two-stack approach as a solution. The interviewer asked for an optimal solution using a heap.
Design a stack that supports push, pop, top, peekMax, and popMax (which removes the most recently added maximum element if there are duplicates). The challenge is to maintain fast retrieval and removal of the current maximum even when it isn't at the top, so choose data structures that allow efficient max lookup and deletion.
Use esses exemplos para entender em que contexto ela costuma cair e adaptar sua prática.
Proposed a two-stack approach as a solution. The interviewer asked for an optimal solution using a heap.
Sem observação adicional neste relato público.
Nenhum anexo público associado a esta pergunta.
No app você encontra perguntas parecidas, compara empresas e aprofunda essa busca com mais filtros.