#K13436. Subsequence Checker
Subsequence Checker
Subsequence Checker
Given two strings, main_str
and sub_str
, determine whether sub_str
is a subsequence of main_str
. A subsequence is 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, "ace" is a subsequence of "abcdef", but "aec" is not.
An empty sub_str
is always considered a subsequence. Print True
if sub_str
is a subsequence of main_str
; otherwise, print False
.
inputFormat
The input consists of two lines:
- The first line contains the string
main_str
. - The second line contains the string
sub_str
.
outputFormat
Output a single line: True
if sub_str
is a subsequence of main_str
, and False
otherwise.
abcdef
ace
True