You are viewing a single comment's thread. Return to all comments →
This is the only solution that worked for me in 2025. Defeats the purpose of reduce enum tho.
Fixnum = Integer Bignum = Integer def sum_terms(n) (1..n).map{|m| m**2+1}.sum() end
Seems like cookies are disabled on this browser, please enable them to open this website
Ruby - Enumerable - reduce
You are viewing a single comment's thread. Return to all comments →
This is the only solution that worked for me in 2025. Defeats the purpose of reduce enum tho.