DEV Community

loading...

Discussion on: Square a number: awful answers only

Collapse
darthbob88 profile image
Raymond Price

AFK, but the method I want to try is just a series of additions; n^2 - (n-1)^2 == n + n-1, so just do that in a for-loop from 1 to n.