Skip to content

Commit

Permalink
Merge pull request neetcode-gh#1247 from zliwow/patch-2
Browse files Browse the repository at this point in the history
Create 392-Is Subsequence.py
  • Loading branch information
Ahmad-A0 authored Oct 8, 2022
2 parents 6efd670 + f8b7203 commit b55ccdd
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 True if i == len(s) else False

0 comments on commit b55ccdd

Please sign in to comment.