String subsequence P40306


Statement
 

pdf   zip

You are given two strings ss and tt with respective lengths mm and nn. Tell if ss is a subsequence of tt, that is, if there is a subset of mm positions of tt, 0j0<<jm1<n0 \le j_0 < \dots < j_{m-1} < n, such that s[i]=t[ji]s[i] = t[j_i] for all 0i<m0 \le i < m. Additionally, tell if there is just one such subset of positions.

Input

Input consists of several cases, each with ss and tt. You can assume 1|s||t|1051 \le \vert s \vert \le \vert t \vert \le 10^5, 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.

Public test cases
  • Input

    abba bbaa
    abba cacbcbca
    abba dababcbaa
    Z ZZ
    r2d2 c3po
    

    Output

    zero
    one
    multiple
    multiple
    zero
    
  • Information
    Author
    Salvador Roura
    Language
    English
    Official solutions
    C++
    User solutions
    C++