Skip to content

Instantly share code, notes, and snippets.

@mohneesh7
Created October 6, 2024 17:32
Show Gist options
  • Save mohneesh7/d71ecadfd28117b62597673c35b22d9b to your computer and use it in GitHub Desktop.
Save mohneesh7/d71ecadfd28117b62597673c35b22d9b to your computer and use it in GitHub Desktop.
Solution for Is Subsequence
# Solution for Is Subsequence
class Solution:
def isSubsequence(self, s: str, t: str) -> bool:
if s == '':
return True
s_list = list(s)
for char in t:
if s_list != [] and char == s_list[0]:
s_list.pop(0)
if s_list == []:
return True
else:
return False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment