Add sum to the Array class
Then do fun stuff like:
| |||||||||
Alternatively (just for comparison), if you have Rails installed (actually just ActiveSupport):
| |||||
Or try the ruby 1.9 way
| |||||||||||||||||||||
|
Add sum to the Array class
Then do fun stuff like:
| |||||||||
Alternatively (just for comparison), if you have Rails installed (actually just ActiveSupport):
| |||||
Or try the ruby 1.9 way
| |||||||||||||||||||||
|