392. 判断子序列

Easy

思路

以上,AC!

代码

python3

class Solution:
    def isSubsequence(self, s: str, t: str) -> bool:
      if s is "":
        return True
      i = 0
      for l in t:
        if s[i] == l:
          i += 1
          if i >= len(s):
            return True
      return False