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

Leetcode 843. Guess the Word

Given a list of unique six-letter words and an API that, for any guessed word from the list, returns the number of characters that match the secret in both value and position, identify the secret within a limited number of guesses. The core challenge is designing a guessing strategy (e.g., minimax or information-gain elimination) that efficiently prunes candidates based on match counts to guarantee finding the secret within allowedGuesses.

Empresas em que apareceu
AmazonAmazonGoogleGoogle
Contextos reais

Onde essa pergunta já apareceu

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

Amazonmiddez. de 2024

Maximize probability of guessing a secret word in 5 tries. Given an interface with isValid(char c) and getWord() methods, implement a function to guess the secret word consisting of uppercase characters. Initially, getWord() returns a string with special characters that get replaced as correct guesses are made.

Googlemidset. de 2024

Guess the password: Given a set of tuples, determine the unique possible password. The password is max 7 characters long, characters are not repeated, and their order must be maintained based on the input tuples.

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.