Description
Given two strings s and t, return true if s is a subsequence of t, or false otherwise. A subsequence is a sequence that can be derived from another sequence by deleting some or no elements without changing the order of the remaining elements.
Examples
Input:
s = "abc", t = "ahbgdc"Output:
trueExplanation:
'abc' is a subsequence of 'ahbgdc'.
Input:
s = "axc", t = "ahbgdc"Output:
falseExplanation:
'axc' is not a subsequence of 'ahbgdc'.
Input:
s = "", t = "ahbgdc"Output:
trueExplanation:
An empty string is a subsequence of any string.
Constraints
- •
0 ≤ s.length ≤ 100 - •
0 ≤ t.length ≤ 10⁴ - •
s and t consist only of lowercase English letters.