Python. Fast solution

  • 0
    class Solution(object):
        def isSubsequence(self, s, t):
            beg = 0
            for char in s:
                beg = t.find(char, beg) + 1
                if not beg:
                    return False
            return True

    12 / 12 test cases passed.
    Status: Accepted
    Runtime: 59 ms

  • 0
    This post is deleted!

Log in to reply

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.