mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-05 07:21:40 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>泰波那契序列 T<sub>n</sub> 定义如下: </p>\n\n<p>T<sub>0</sub> = 0, T<sub>1</sub> = 1, T<sub>2</sub> = 1, 且在 n >= 0 的条件下 T<sub>n+3</sub> = T<sub>n</sub> + T<sub>n+1</sub> + T<sub>n+2</sub></p>\n\n<p>给你整数 <code>n</code>,请返回第 n 个泰波那契数 T<sub>n </sub>的值。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre><strong>输入:</strong>n = 4\n<strong>输出:</strong>4\n<strong>解释:</strong>\nT_3 = 0 + 1 + 1 = 2\nT_4 = 1 + 1 + 2 = 4\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre><strong>输入:</strong>n = 25\n<strong>输出:</strong>1389537\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>0 <= n <= 37</code></li>\n\t<li>答案保证是一个 32 位整数,即 <code>answer <= 2^31 - 1</code>。</li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Easy",
|
||||
"likes": 195,
|
||||
"likes": 198,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[{\"title\": \"Climbing Stairs\", \"titleSlug\": \"climbing-stairs\", \"difficulty\": \"Easy\", \"translatedTitle\": \"\\u722c\\u697c\\u68af\"}]",
|
||||
@@ -149,7 +149,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"117.9K\", \"totalSubmission\": \"194.2K\", \"totalAcceptedRaw\": 117949, \"totalSubmissionRaw\": 194176, \"acRate\": \"60.7%\"}",
|
||||
"stats": "{\"totalAccepted\": \"118.5K\", \"totalSubmission\": \"195.1K\", \"totalAcceptedRaw\": 118529, \"totalSubmissionRaw\": 195070, \"acRate\": \"60.8%\"}",
|
||||
"hints": [
|
||||
"Make an array F of length 38, and set F[0] = 0, F[1] = F[2] = 1.",
|
||||
"Now write a loop where you set F[n+3] = F[n] + F[n+1] + F[n+2], and return F[n]."
|
||||
|
Reference in New Issue
Block a user