Pretty much straight out of Leetcode
Leetcode 1762. Buildings With an Ocean View
Given an array of building heights, return the indices of buildings that have an unobstructed view to the ocean on the right (i.e., no building of equal or greater height between them and the edge). This is typically solved by a right-to-left scan or a monotonic decreasing stack that tracks the current maximum height.
Onde essa pergunta já apareceu
Use esses exemplos para entender em que contexto ela costuma cair e adaptar sua prática.
Materiais associados
Nenhum anexo público associado a esta pergunta.
Depois de treinar essa pergunta, vale abrir outras do mesmo tipo e da mesma senioridade para comparar padrões de resposta.
Isso ajuda a sair da memorização de uma resposta só e entrar em repertório real de entrevista.
Continue a preparação com o banco completo
No app você encontra perguntas parecidas, compara empresas e aprofunda essa busca com mais filtros.