Given strings X and Y, determine whether X is a subsequence of Y. The empty string is regarded as a subsequence of every string. (E.g.,
'anna' are subsequences of
- X, a possibly-empty case-sensitive alphanumeric string
- Y, a possibly-empty case-sensitive alphanumeric string
- True or False (or equivalents), correctly indicating whether X is a subsequence of Y.
X Y output '' 'z00' True 'z00' 'z00' True 'z00' '00z0' False 'aa' 'anna' True 'anna' 'banana' True 'Anna' 'banana' False
- The shortest program wins, as determined by the number of bytes of source code.
- Several programs that could be adapted are in this related posting.