#K92377. Is Subsequence
Is Subsequence
Is Subsequence
Given two strings \(s\) and \(t\), determine whether \(t\) is a subsequence of \(s\). A subsequence of a string is a new string that is formed from the original string by deleting some (or none) of the characters without disturbing the relative positions of the remaining characters.
Mathematically, \(t\) is a subsequence of \(s\) if there exist indices \(i_1, i_2, \dots, i_n\) such that \(0 \leq i_1 < i_2 < \dots < i_n < m\) (where \(m\) is the length of \(s\)) and \(s[i_j] = t[j]\) for all valid \(j\). Note that an empty string is considered a subsequence of any string.
inputFormat
The input consists of two lines:
- The first line contains the string \(s\).
- The second line contains the string \(t\).
outputFormat
Output a single line: "true" if \(t\) is a subsequence of \(s\), and "false" otherwise.
## sampleabpcplea
apple
true