Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Comment
by
mxbr
· 7y ago · 0 comments
2 * (1..12).reduce(&:+)
You could also use the closed summation formula: (n^2 + n) / 2. In our case that shortens to just 12*13=156.
Comments
No comments yet.
Better HN