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)