Is It a Subsequence
Is A a subsequence of B — can A be obtained from B by deleting characters without reordering?
Input: two lines: string A, then string B.
Output: YES or NO.
Constraints:
- 1 ≤ |A|, |B| ≤ 104
- lowercase letters
Sample Tests
Input 1
ace abcde
Output 1
YES
Input 2
aec abcde
Output 2
NO
Discussion (opens after you solve — no spoilers before)
No comments yet.