Is Subsequence
EasyTwo Pointers
Decode it first. Clues, constraints, pattern and plan before any code.Given two strings s and t, return true if s is a subsequence of t. A subsequence is what you get by deleting zero or more characters from t without changing the order of the characters that remain.
s = "abc", t = "ahbgdc" → true (a, b, c appear in order)
s = "axc", t = "ahbgdc" → false (there is no x)
s = "", t = "abc" → true (the empty string is a subsequence of anything)Constraints
0 <= s.length <= 1000 <= t.length <= 10^4sandtcontain only lowercase English letters.