1716. Calculate Money in Leetcode Bank

Обновлено: 2024-03-12
1 мин
[]

Содержание

LeetCode problem 1716

class Solution:
    def totalMoney(self, n: int) -> int:
        a, b = divmod(n, 7)
        return (28 + 28 + 7 * (a - 1)) * a // 2 + (a * 2 + b + 1) * b // 2