You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given two strings s and t we need to tell whether s is subsequence of t or not
We can use map to keep track of characters of s but in this approach the relative order of the characters may not be same i.e. maybe the characters are present
but not the subsequence
OR
We can keep two pointers each on s and t and traverse each string if both the characters are equal we can move the pointers next if not then we need to move only