T*u
2 楼
in the example, why it is not 2, such as the subsequences of T are 'rabb'
and 'bit'
#########################################################
Given a string S and a string T, count the number of distinct subsequences
of T in S.
A subsequence of a string is a new string which is formed from the original
string by deleting some (can be none) of the characters without disturbing
the relative positions of the remaining characters. (ie, "ACE" is a
subsequence of "ABCDE" while "AEC" is not).
Here is an example:
S = "rabbbit", T = "rabbit"
Return 3.
and 'bit'
#########################################################
Given a string S and a string T, count the number of distinct subsequences
of T in S.
A subsequence of a string is a new string which is formed from the original
string by deleting some (can be none) of the characters without disturbing
the relative positions of the remaining characters. (ie, "ACE" is a
subsequence of "ABCDE" while "AEC" is not).
Here is an example:
S = "rabbbit", T = "rabbit"
Return 3.
a*r
3 楼
叫名字就过来,
扔出去球会叼回来等着继续扔,
无聊的时候会叼过来一个球递到我手里,叫我给它扔出去玩,
无论何时我上厕所,都端坐门口等着,
说sit就坐下,
说躺下就露肚皮躺下,
睡觉时候一叫就乖乖回卧室。。。
tabby cat,不到五个月。感觉养猫跟养狗差不多了,还不用遛。自觉赚了大便宜,哈哈
扔出去球会叼回来等着继续扔,
无聊的时候会叼过来一个球递到我手里,叫我给它扔出去玩,
无论何时我上厕所,都端坐门口等着,
说sit就坐下,
说躺下就露肚皮躺下,
睡觉时候一叫就乖乖回卧室。。。
tabby cat,不到五个月。感觉养猫跟养狗差不多了,还不用遛。自觉赚了大便宜,哈哈
c*3
4 楼
This question needs to be reworded like "count the number of distinct
subsequences of S that equals T".
Threre are three of them in total.
ra*bbit, rab*bit and rabb*it
subsequences of S that equals T".
Threre are three of them in total.
ra*bbit, rab*bit and rabb*it
相关阅读