Squash commit

This commit is contained in:
Tay Yang Shun
2017-09-20 15:27:28 +08:00
commit 2182a70770
70 changed files with 5486 additions and 0 deletions

View File

@ -0,0 +1,13 @@
def is_subsequence(s, t):
"""
:type s: str
:type t: str
:rtype: bool
"""
if len(s) > len(t):
return False
matched_s = 0
for char in t:
if matched_s < len(s) and s[matched_s] == char:
matched_s += 1
return matched_s == len(s)