[
greedy
dp
binary search
two pointers
]
BinarySearch 0021 Subsequence Strings
Problem statement
https://binarysearch.com/problems/Subsequence-Strings/
Solution
Equal to Leetcode 0392. Is Subsequence
Complexity
It is O(n + m)
for time and space.
Code
class Solution:
def solve(self, s, t):
t = iter(t)
return all(c in t for c in s)