mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-08 08:51:42 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "可以用字符串表示一个学生的出勤记录,其中的每个字符用来标记当天的出勤情况(缺勤、迟到、到场)。记录中只含下面三种字符:\n<ul>\n\t<li><code>'A'</code>:Absent,缺勤</li>\n\t<li><code>'L'</code>:Late,迟到</li>\n\t<li><code>'P'</code>:Present,到场</li>\n</ul>\n\n<p>如果学生能够 <strong>同时</strong> 满足下面两个条件,则可以获得出勤奖励:</p>\n\n<ul>\n\t<li>按 <strong>总出勤</strong> 计,学生缺勤(<code>'A'</code>)<strong>严格</strong> 少于两天。</li>\n\t<li>学生 <strong>不会</strong> 存在 <strong>连续</strong> 3 天或 <strong>连续</strong> 3 天以上的迟到(<code>'L'</code>)记录。</li>\n</ul>\n\n<p>给你一个整数 <code>n</code> ,表示出勤记录的长度(次数)。请你返回记录长度为 <code>n</code> 时,可能获得出勤奖励的记录情况 <strong>数量</strong> 。答案可能很大,所以返回对 <code>10<sup>9</sup> + 7</code> <strong>取余</strong> 的结果。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>n = 2\n<strong>输出:</strong>8\n<strong>解释:\n</strong>有 8 种长度为 2 的记录将被视为可奖励:\n\"PP\" , \"AP\", \"PA\", \"LP\", \"PL\", \"AL\", \"LA\", \"LL\" \n只有\"AA\"不会被视为可奖励,因为缺勤次数为 2 次(需要少于 2 次)。\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>n = 1\n<strong>输出:</strong>3\n</pre>\n\n<p><strong>示例 3:</strong></p>\n\n<pre>\n<strong>输入:</strong>n = 10101\n<strong>输出:</strong>183236316\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= n <= 10<sup>5</sup></code></li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Hard",
|
||||
"likes": 261,
|
||||
"likes": 262,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[{\"title\": \"Student Attendance Record I\", \"titleSlug\": \"student-attendance-record-i\", \"difficulty\": \"Easy\", \"translatedTitle\": \"\\u5b66\\u751f\\u51fa\\u52e4\\u8bb0\\u5f55 I\"}]",
|
||||
@@ -137,7 +137,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"25.3K\", \"totalSubmission\": \"43.8K\", \"totalAcceptedRaw\": 25291, \"totalSubmissionRaw\": 43780, \"acRate\": \"57.8%\"}",
|
||||
"stats": "{\"totalAccepted\": \"25.3K\", \"totalSubmission\": \"43.8K\", \"totalAcceptedRaw\": 25303, \"totalSubmissionRaw\": 43810, \"acRate\": \"57.8%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
|
Reference in New Issue
Block a user