392. Is Subsequence
easyTwo Pointers · String · Dynamic Programming
read the problem on leetcode →
first solved 14 Sept 2026
class Solution:
def isSubsequence(self, s: str, t: str) -> bool:
i = 0
for char in t:
if i < len(s) and s[i] == char:
i += 1
return i == len(s)