Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
6 lines (4 sloc) 115 Bytes
def solver(num, grade)
(num**grade).to_s.split("").inject(0) { |sum, n| sum + n.to_i }
end
puts solver(2, 1000)
Jump to Line
Something went wrong with that request. Please try again.