Skip to content

Latest commit

 

History

History
14 lines (11 loc) · 324 Bytes

8 kyu - Beginner - Reduce but Grow.md

File metadata and controls

14 lines (11 loc) · 324 Bytes

Task

Given and array of integers (x), return the result of multiplying the values together in order. Example:

[1, 2, 3] --> 6 For the beginner, try to use the reduce method - it comes in very handy quite a lot so is a good one to know.

Array will not be empty.

My solution

def grow(x) 
  x.reduce(:*)
end