Novo curso: Como conseguir vagas remotas em empresas que pagam $120k+/ano
NaGringa
CodingMid-level

Leetcode 149. Max Points on a Line

Given up to 300 unique 2D points, return the maximum number that lie on the same straight line. The core challenge is grouping points by slope from each pivot (handling vertical lines and slope precision) to compute the answer in O(n^2) time using normalized slope keys.

Empresas em que apareceu
GoogleGoogle
Contextos reais

Onde essa pergunta já apareceu

Use esses exemplos para entender em que contexto ela costuma cair e adaptar sua prática.

Googlemidjan. de 2025

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

Anexos públicos

Materiais associados

Nenhum anexo público associado a esta pergunta.

Próximo passo

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.