Link: https://leetcode.com/problems/divisible-and-non-divisible-sums-difference/ ## Code ```python= class Solution: def differenceOfSums(self, n: int, m: int) -> int: num2 = 0 for i in range(1, n+1): if i%m == 0: num2 += i return ((1+n)*n)//2-2*num2 ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up