Is a Subsequence

L3 Easy Two Pointers
Concept
Two pointers can walk two strings at once. To check subsequence, match characters greedily: advance the needle pointer only on a match, always advance the haystack pointer.
Given strings s and t, return true if s is a subsequence of t — that is, you can delete some characters from t (possibly zero) and be left with exactly s — otherwise return false.
Examples
▸ s = "abc", t = "ahbgdc"
→ true
▸ s = "axc", t = "ahbgdc"
→ false
▸ s = "", t = "anything"
→ true
Progressive Hints
Hint 1 · Nudge
Try to match t against s in order, never stepping backwards.
Hint 2 · Plan
Keep an index into s. Loop over the characters of t; each time a character matches the character of s at that index, advance the index. If the index reaches the end of s, return true.
Hint 3 · Approach
i = 0. For each c in t: if i is smaller than s's length and c == s[i], then i = i + 1. Return true exactly when i reached the end of s.
Output
// Run your code to see the output here.