Easy python solution


  • 0
    Y
    class Solution(object):
        def isSubsequence(self, s, t):
            i=0
            try:
                for x in t:
                    if s[i]==x:
                        i+=1
            finally:
                return i==len(s)
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.