1716. 计算力扣银行的钱
为保证权益,题目请参考 1716. 计算力扣银行的钱(From LeetCode).
解决方案1
Python
python
# 1716. 计算力扣银行的钱
# https://leetcode-cn.com/problems/calculate-money-in-leetcode-bank/
class Solution:
def totalMoney(self, n: int) -> int:
week, day = 1, 1
res = 0
for i in range(n):
res += week + day - 1
day += 1
if day == 8:
day = 1
week += 1
return res
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15