由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - leetcode一题没看明白
相关主题
Question on leetcode Distinct Subsequences那个leetcode上头得distinct subsequence什么意思
问道leetcode上的题:distinct subsequence贡献F家Onsite一题
求解这个动态规划题求助:leetcode上的Distinct Subsequences这个怎么理解
leetcode115求帮理解 LeetCode 上的Distinct Subsequences这道题究竟是什么意思???
大家帮忙解释一个 LeetCode DP (distinct subsequences)DP的状态转移方程
Distinct Subsequence贴一下我google第一轮店面的题目
请教道算法题Bloomberg面试题
问一道算法题max length of subsequence string matching subs分享Imo电面题
相关话题的讨论汇总
话题: string话题: distinct话题: characters
进入JobHunting版参与讨论
1 (共1页)
s*******e
发帖数: 1630
1
Distinct Subsequences
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.
S和T究竟什么关系?怎么得出3的?
r*******e
发帖数: 7583
2
从S里面抽出subsequence来组成T
S里面有3个b,抽出2个,有三种抽法

original

【在 s*******e 的大作中提到】
: Distinct Subsequences
: 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.

s*******e
发帖数: 1630
3
我一开始也是这么理解的,但不是说要distinct吗,这样也算?
r*********n
发帖数: 4553
4
选出来的b在原字符串里的位置不同吧

【在 s*******e 的大作中提到】
: 我一开始也是这么理解的,但不是说要distinct吗,这样也算?
H****r
发帖数: 2801
5
这题目描述让人发指,估计是考和面试官交流能力的...

original

【在 s*******e 的大作中提到】
: Distinct Subsequences
: 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.

1 (共1页)
进入JobHunting版参与讨论
相关主题
分享Imo电面题大家帮忙解释一个 LeetCode DP (distinct subsequences)
这段LIS为啥崩溃?Distinct Subsequence
有人同看Longest Palindromic Substring 这道题么?请教道算法题
DP通项公式问一道算法题max length of subsequence string matching subs
Question on leetcode Distinct Subsequences那个leetcode上头得distinct subsequence什么意思
问道leetcode上的题:distinct subsequence贡献F家Onsite一题
求解这个动态规划题求助:leetcode上的Distinct Subsequences这个怎么理解
leetcode115求帮理解 LeetCode 上的Distinct Subsequences这道题究竟是什么意思???
相关话题的讨论汇总
话题: string话题: distinct话题: characters