What is distinct subsequence?


  • 4
    Y

    i.e. "ABCDE": are "ABC" and "ACE" considered distinct subsequences?


  • 0
    T

    This is a good question. This problem is not well defined. I don't understand how so many people managed to come up with solutions. A subsequence is defined, but a distinct subsequence is not defined. More importantly for "ABCDE", are "ABCD" and "BCD" distinct subsequences?


  • 10
    J

    I think you guys didn't understand the question. the question is asking how many distinct substrings of "T" in S.
    Not substrings that come from T, but substrings that is exactly == T.

    For example, S = aab, T=ab. then (0)+(2) in S == "ab" (1)+(2) in S = "ab".
    So S has 2 substrings T inside.


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.