All prompts are owned by LeetCode. To view the prompt, click the title link above.
First completed : May 22, 2024
Last updated : July 01, 2024
Related Topics : Math
Acceptance Rate : 89.41 %
class Solution:
def differenceOfSums(self, n: int, m: int) -> int:
return (1 + n) * n // 2 - ((m * (1 + n // m)) * (n // m))