Advertisement
Syldarion

LC 287

Oct 18th, 2021
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.10 KB | None | 0 0
  1. sum = 0
  2. nsum = 0
  3. for n in range(len(nums)):
  4. sum += nums[n]
  5. nsum += n
  6. return abs(sum - nsum)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement