#K79827. Subsequence Checker

    ID: 35395 Type: Default 1000ms 256MiB

Subsequence Checker

Subsequence Checker

You are given two strings, ( s1 ) and ( s2 ). Your task is to determine whether ( s1 ) is a subsequence of ( s2 ). A subsequence of a string is obtained by deleting zero or more characters from the original string without changing the order of the remaining characters. For example, if ( s1 = \texttt{abc} ) and ( s2 = \texttt{ahbgdc} ), then ( s1 ) is a subsequence of ( s2 ) because the characters 'a', 'b', 'c' appear in order in ( s2 ).

inputFormat

The input consists of two lines. The first line contains the string ( s1 ) and the second line contains the string ( s2 ). Both strings may be empty.

outputFormat

Output a single line: ( True ) if ( s1 ) is a subsequence of ( s2 ), otherwise ( False ).## sample

abc
ahbgdc
True