The question should be reworded.


  • 61
    S

    Given a string S and a string T, count the number of distinct subsequences of T in S.

    should be reworded to

    Given a string S and a string T, count the number of distinct subsequences of S which equals T.

    or

    Given a string S and a string T, count the number of distinct sequences of T in S.

    In the original description, subsequences of T could be any subsequences which are not necessary to be equal to T.

    @administrators Can you please improve the description?


  • 3
    A

    I think 'subsequences T in S' is better.


  • 0
    C

    Could not agree more.


  • 2
    O

    finally understand why the example has an answer of 3!!


  • 0
    S

    I finally get a grasp of what the question is about...


  • 0
    J

    Thanks. Finally I understand the question...


  • 3
    I

    I think I now understand where 3 comes from. But, given that all of the subsequences should equal T, they're not distinct are they? I guess you could consider them distinct from the standpoint that you're removing a character at a different index to create the subsequence.

    In plain English, my understanding of the problem is now this: How many ways can you generate the string T by only removing (but not reordering) characters in S?


  • 0
    L

    Thanks a lot! Can not agree more!


  • 0

    Thank you very much!


  • 1
    Q

    Thanks. So, allow me to do a finally clarification.
    I like the comment of @intvnut most.
    "In plain English, my understanding of the problem is now this: How many ways can you generate the string T by only removing (but not reordering) characters in S?"

    So in the original example, T is rabbit
    S is r a b b b i t
    ^ ^ ^
    we can remove one of the 3 b's from S and get T. And thus there are 3 ways.


  • 1
    A

    @ziang it should not include a keyword of distinct.


  • 0
    A

    @quesder finally I understood it!
    now it's much easier to understand the algorithm for resolving it.


  • 0
    M

    Why is this ILLITERATE question still here in its original form after 3 years when it is most certainly worded improperly. How many people have WASTED time staring at it and trying to figure it out?

    If anyone gave a crap about this site they would have fixed it long ago.


  • 0

    Sorry, was late to notice this. Just updated the problem description, thanks!


Log in to reply
 

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