String subsequence

You are given two strings s and t with respective lengths m and n. Tell
if s is a subsequence of t, that is, if there is a subset of m positions
of t, 0 ≤ j₀ < … < j_(m − 1) < n, such that s[i] = t[j_(i)] for all
0 ≤ i < m. Additionally, tell if there is just one such subset of
positions.

Input

Input consists of several cases, each with s and t. You can assume
1 ≤ |s| ≤ |t| ≤ 10⁵, and that the words are made up of only digits and
lowercase and uppercase letters.

Output

For every case, tell if there are zero solutions, just one solution, or
multiple solutions.

Problem information

Author: Salvador Roura

Generation: 2026-01-25T11:02:09.898Z

© Jutge.org, 2006–2026.
https://jutge.org
