mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-02 14:12:17 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给定一个字符串 s,返回 <em><code>s</code> 中不同的非空「回文子序列」个数 。</em></p>\n\n<p>通过从 s 中删除 0 个或多个字符来获得子序列。</p>\n\n<p>如果一个字符序列与它反转后的字符序列一致,那么它是「回文字符序列」。</p>\n\n<p>如果有某个 <code>i</code> , 满足 <code>a<sub>i</sub> != b<sub>i</sub></code><sub> </sub>,则两个序列 <code>a<sub>1</sub>, a<sub>2</sub>, ...</code> 和 <code>b<sub>1</sub>, b<sub>2</sub>, ...</code> 不同。</p>\n\n<p><strong>注意:</strong></p>\n\n<ul>\n\t<li>结果可能很大,你需要对 <code>10<sup>9</sup> + 7</code> 取模 。</li>\n</ul>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>s = 'bccb'\n<strong>输出:</strong>6\n<strong>解释:</strong>6 个不同的非空回文子字符序列分别为:'b', 'c', 'bb', 'cc', 'bcb', 'bccb'。\n注意:'bcb' 虽然出现两次但仅计数一次。\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>s = 'abcdabcdabcdabcdabcdabcdabcdabcddcbadcbadcbadcbadcbadcbadcbadcba'\n<strong>输出:</strong>104860361\n<strong>解释:</strong>共有 3104860382 个不同的非空回文子序列,104860361 对 10<sup>9</sup> + 7 取模后的值。\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= s.length <= 1000</code></li>\n\t<li><code>s[i]</code> 仅包含 <code>'a'</code>, <code>'b'</code>, <code>'c'</code> 或 <code>'d'</code> </li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Hard",
|
||||
"likes": 156,
|
||||
"likes": 157,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[{\"title\": \"Longest Palindromic Subsequence\", \"titleSlug\": \"longest-palindromic-subsequence\", \"difficulty\": \"Medium\", \"translatedTitle\": \"\\u6700\\u957f\\u56de\\u6587\\u5b50\\u5e8f\\u5217\"}]",
|
||||
@@ -143,7 +143,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"4.5K\", \"totalSubmission\": \"8.9K\", \"totalAcceptedRaw\": 4460, \"totalSubmissionRaw\": 8915, \"acRate\": \"50.0%\"}",
|
||||
"stats": "{\"totalAccepted\": \"4.5K\", \"totalSubmission\": \"8.9K\", \"totalAcceptedRaw\": 4465, \"totalSubmissionRaw\": 8922, \"acRate\": \"50.0%\"}",
|
||||
"hints": [
|
||||
"Let dp(i, j) be the answer for the string T = S[i:j+1] including the empty sequence. The answer is the number of unique characters in T, plus palindromes of the form \"a_a\", \"b_b\", \"c_c\", and \"d_d\", where \"_\" represents zero or more characters."
|
||||
],
|
||||
|
Reference in New Issue
Block a user