Is Subsequence
Intuition Another way to read the problem is: find if all s characters are present in t, in the same order. It doesn’t have to be consecutive. We need to keep two pointers: One for the string t One for the string s We got loop through the string t, and if t[tPointer] == s[iPointer], we increase both. If t[tPointer] != s[iPointer], will increase just tPointer. At the end if iPointer==len(s) we reach end of s, we are good, return True This will be solved in time O(n) and space(1), since is one pass and we don’t use additional structures other than the pointers. ...