#K58947. Subsequence Check
Subsequence Check
Subsequence Check
Given two strings S and T, determine whether S is a subsequence of T. A string S is considered a subsequence of T if all characters of S appear in T in the same order (not necessarily consecutively). For example, if S = and T = , then S is a subsequence of T, so the answer is "Yes". However, if S = and T = , then the answer is "No".
Note: An empty string is considered a subsequence of any string.
This problem tests your understanding of the two-pointer technique.
inputFormat
The input consists of two lines. The first line contains the string S, and the second line contains the string T.
outputFormat
Output a single line: "Yes" if S is a subsequence of T, otherwise "No".## sample
abc
ahbgdc
Yes