Given two arrays of characters `arr` and `sub`, determine if `sub` is a subsequence of `arr`. A subsequence is a sequence that can be derived from another sequence by deleting some elements without changing the order of the remaining elements.
Explanation: All elements of sub ["a", "c", "e"] appear in arr in the same relative order, so it is a subsequence.
Analyze constraints and compute optimal solutions step-by-step.
No dry run loaded.
🚀 Practice this problem
Run code, get AI hints & track streak