Skip to content

Commit

Permalink
Create: 392-is-subsequence.py
Browse files Browse the repository at this point in the history
  • Loading branch information
UdayGarg committed Oct 1, 2022
1 parent ff19b2a commit 75cf544
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions python/392-is-subsequence.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
class Solution:
def isSubsequence(self, s: str, t: str) -> bool:
i, j = 0, 0
while i < len(s) and j < len(t):
if s[i] == t[j]:
i += 1
j += 1
return i == len(s)

0 comments on commit 75cf544

Please sign in to comment.