#C6772. Subsequence Checker

    ID: 50569 Type: Default 1000ms 256MiB

Subsequence Checker

Subsequence Checker

We define a subsequence as follows: Given two strings (A) and (B), (B) is a subsequence of (A) if there exists a sequence of indices (1 \leq i_1 < i_2 < \dots < i_k \leq |A|) such that (A[i_j] = B[j]) for all (j = 1, 2, \dots, k). In this problem, you are given two strings (A) and (B), and your task is to determine whether (B) is a subsequence of (A). Output 'True' if it is, and 'False' otherwise.

inputFormat

The input consists of two lines. The first line contains the string (A), and the second line contains the string (B). Both strings consist of printable characters and do not contain leading or trailing spaces.

outputFormat

Output a single line: 'True' if (B) is a subsequence of (A), otherwise 'False'.## sample

abdefghij
bdg
True

</p>