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

Leetcode 527. Word Abbreviation

Given a list of words, generate the shortest unique abbreviation for each word of the form prefix + count of omitted middle letters + last letter (or keep the full word if abbreviation isn't shorter), resolving conflicts by expanding the shared prefix until every abbreviation is unique. The core challenge is grouping conflicting words and efficiently finding the minimal prefix length (often via grouping or a trie) needed to make each abbreviation distinct.

Empresas em que apareceu
MetaMeta
Contextos reais

Onde essa pergunta já apareceu

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

Metaseniornov. de 2025

given 2 strings, one being alphaneumeric abbreviation and other being bigger string. return boolean if bigger string is satisfies the pattern of smaller string as its abbreviation. For ex. string a = "i18n" b = "internationalization", a = "8" b = "Facebook", a = "a2b3c" c = "aaabbbbc"

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.