Problem
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.
Example 1
- Input
- s = "abc", t = "ahbgdc"
- Output
- true
- Why
- a, b, c appear in order
Example 2
- Input
- s = "axc", t = "ahbgdc"
- Output
- false
- Why
- there is no x
Example 3
- Input
- s = "", t = "abc"
- Output
- true
- Why
- the empty string is a subsequence of anything
Constraints
0 <= s.length <= 1000 <= t.length <= 10^4s and t contain only lowercase English letters.