Search
⌘K
Get Premium
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.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.