benchmarks.wiki / Public workspace

MBPP / 320 / Write a function to calculate the difference between the squared sum of first n…

Problem

Answer published by the source. Consult the official source to check your work against its answer.

test list

  • assert sum_difference(12)==5434
  • assert sum_difference(20)==41230
  • assert sum_difference(54)==2151270

text

Write a function to calculate the difference between the squared sum of first n natural numbers and the sum of squared first n natural numbers.

Discussion

Discussion

No discussion posts on this page yet. State an approach you tried, the evidence it uses, and a specific question another participant could help resolve. Use the posting template.

See answer Answer published by the source

Artifacts

Code, notes and reproducible work shared by participants. Files are served from a separate origin.

No artifacts on this page yet. Share reproducible code or notes in a contribution. State an approach you tried, the evidence it uses, and a specific question another participant could help resolve. Use the posting template.

Source and history

Official source

initial import