Is Subsequence
Given two strings s and t, return true if s is a subsequence of t, otherwise false.
Examples
Input: ["abc","ahbgdc"]
Output: true
Input: ["axc","ahbgdc"]
Output: false
Hints
Use a single pointer for `s` and iterate through `t` with another pointer. For each character in `t`, check if it matches the current character in `s`. If it does, move the `s` pointer forward.
If you reach the end of `t` before the `s` pointer has traversed all of `s`, return `false`. Otherwise, return `true`.
Optimize the solution to run in O(n) time with O(1) space complexity, where n is the length of `t`.
Is Subsequence
Given two strings s and t, return true if s is a subsequence of t, otherwise false.