Given two strings s and t, return true if s is a subsequence of t, or false otherwise. A subsequence of a string is a new string that is formed from the original string by deleting some (can be none) of the characters without disturbing the relative positions of the remaining characters. (i.e., "ace" is a subsequence of "abcde" while "aec" is not).
CodingSenior
Leetcode 392. Is Subsequence
Check whether string s can be obtained from t by deleting some characters without reordering (i.e., whether s is a subsequence of t), typically solved with a greedy two-pointer scan in O(|t|+|s|). For many queries, preprocess t (e.g., build a next-occurrence table or char→sorted indices) to answer each s quickly by jumping to the next matching positions.
Contextos reais
Onde essa pergunta já apareceu
Use esses exemplos para entender em que contexto ela costuma cair e adaptar sua prática.
Metaseniorfev. de 2026
Anexos públicos
Materiais associados
Nenhum anexo público associado a esta pergunta.
Sinais de resposta forte
Você deixa claro por que escolheu essa abordagem e o que descartou.
Seu código vem acompanhado de testes mentais e edge cases relevantes.
Sua explicação ajuda o entrevistador a acompanhar o raciocínio em tempo real.
O que costuma enfraquecer a resposta
Entrar direto no código sem alinhar interpretação do problema.
Passar tempo demais em silêncio e só explicar no fim.
Ignorar complexidade, invariantes e estratégia de teste.
Continue a preparação com o banco completo
No app você encontra perguntas parecidas, compara empresas e aprofunda essa busca com mais filtros.