# 【Leetcode】NO.1716 计算力扣银行的钱（Python）【打卡】([leetcode] no.1716 calculation force deduction of bank money (Python) [punch in])-python

## 【Leetcode】NO.1716 计算力扣银行的钱（Python）【打卡】([leetcode] no.1716 calculation force deduction of bank money (Python) [punch in])

### 题目 1716. 计算力扣银行的钱

Hercy 想要为购买第一辆车存钱。他 每天 都往力扣银行里存钱。

### 代码

``````
class Solution:
def totalMoney(self, n: int) -> int:
total = 0
for i in range(1,n+1):
total += (i-1)//7 + (i-1)%7+1 # 周数整除+余数天数

``````
————————

### Title 1716 Calculate the power to deduct money from the bank

Hercy wants to save money for her first car. He deposits money in the Likou bank every day.

At first, he deposited a dollar on Monday. From Tuesday to Sunday, he deposited 1 yuan more every day than the previous day. In the following Monday, he will deposit 1 yuan more than the previous Monday.

Here you are n, please return to the total amount of money he deposited in Likou bank at the end of day n.

### thinking

Add weeks per day per week, starting from 0; The remainder is days;

### code

``````
class Solution:
def totalMoney(self, n: int) -> int:
total = 0
for i in range(1,n+1):
total += (i-1)//7 + (i-1)%7+1 # 周数整除+余数天数