<reponame>samkitsheth95/InterviewPrep<filename>com/Leetcode/392.IsSubsequence.py
class Solution:
    def isSubsequence(self, s: str, t: str) -> bool:
        i = 0
        j = 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


sol = Solution()
print(sol.isSubsequence(s="abc", t="ahbgdc"))

class Solution:
    def isSubsequence(self, s: str, t: str) -> bool:
        i = 0
        j = 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


sol = Solution()
print(sol.isSubsequence(s="abc", t="ahbgdc"))