Prerequisite:
String in Python | Part 2.3 | Castor Classes
https://www.youtube.com/watch?v=65z1V...
Check the problem statement here:
https://leetcode.com/problems/is-subs...
Python for beginners:
https://www.youtube.com/watch?v=egq7Z...

Code:

class Solution:

def isSubsequence(self, s: str, t: str) -> bool:

g=0;

for i in s:

if(i in t):

rs=t.index(i);

t=t[rs+1:];

else:

g+=1;

if(g==0):

return True;

else:

return False;

Code:

class Solution:

def isSubsequence(self, s: str, t: str) -> bool:

g=0;

for i in s:

if(i in t):

rs=t.index(i);

t=t[rs+1:];

else:

g+=1;

if(g==0):

return True;

else:

return False;

## 0 Comments:

## Post a Comment