#K45737. Subsequence Check
Subsequence Check
Subsequence Check
Given two strings s1 and s2, determine whether s1 is a subsequence of s2. A subsequence is defined as a sequence that can be derived from another string by deleting some or no characters without changing the order of the remaining characters. For example, abc
is a subsequence of ahbgdc
whereas axc
is not.
inputFormat
The input consists of two lines. The first line contains the string s1 (the potential subsequence) and the second line contains the string s2 (the target string).
outputFormat
Output a single line containing True
if s1 is a subsequence of s2, or False
otherwise.
abc
ahbgdc
True