Skip to content

Latest commit

 

History

History
31 lines (21 loc) · 705 Bytes

_2894. Divisible and Non-divisible Sums Difference.md

File metadata and controls

31 lines (21 loc) · 705 Bytes

All prompts are owned by LeetCode. To view the prompt, click the title link above.

Back to top


First completed : May 22, 2024

Last updated : July 01, 2024


Related Topics : Math

Acceptance Rate : 89.41 %


Solutions

Python

class Solution:
    def differenceOfSums(self, n: int, m: int) -> int:
        return (1 + n) * n // 2 - ((m * (1 + n // m)) * (n // m))