LeetCode All in One 题目讲解汇总(持续更新中...)
Given a positive integer n , return the number of all possible attendance records with length n, which will be regarded as rewardable. The answer may be very large, return it after mod 10 9 + 7. A student attendance record is a string that only contains the following three characters: 'A' : Absent. 'L' : Late. 'P' : Present. A record is regarded as rewardable if it doesn't contain more than one 'A' (absent) or more than two continuous 'L' (late) . Example 1: Input: n = 2 Output: 8 Explanation: There are 8 records with length 2 will be regarded as rewardable: "PP" , "AP", "PA", "LP", "PL", "AL"