Given a list of points representing cakes on a table, where each point is [x, y, l] (x and y are coordinates, l is length and height of the cake), find a horizontal line such that the line divides the cakes into equal portions above and below it
Leetcode 3453. Separate Squares I
Given axis-aligned squares (xi, yi, li) whose overlaps count multiply, find the smallest horizontal line y such that the sum of areas of all squares above y equals the sum below. The core approach is to exploit that the area difference is monotonic in y and binary-search the y-coordinate, computing each square's above/below contribution by its vertical overlap.
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.