Skip to content

Commit f482619

Browse files
Merge pull request #2019 from CodingTestStudy2/최원준
[최원준] Day13
2 parents 438d930 + ac35ebd commit f482619

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
class Solution:
2+
def numOfWays(self, n: int) -> int:
3+
MOD = 1_000_000_007
4+
5+
aba = 6
6+
abc = 6
7+
8+
for _ in range(1, n):
9+
aba, abc = (
10+
(aba * 3 + abc * 2) % MOD,
11+
(aba * 2 + abc * 2) % MOD
12+
)
13+
return (aba + abc) % MOD

0 commit comments

Comments
 (0)