110. Is Subsequence
EasyTwo Pointers
Print YES if s is a subsequence of t (s can be formed by deleting some characters of t without reordering), else NO.
Input format
Line 1: s Line 2: t
Output format
YES or NO
Example 1
Input
abc ahbgdc
Output
YES
Example 2
Input
axc ahbgdc
Output
NO
Constraints
1 ≤ |s|, |t| ≤ 10⁵
Read input from standard input and print the answer to standard output. Your code is judged against 5 test cases, most of them hidden.
Loading the MyLoginn IDE…