Skip to content

Latest commit

 

History

History
15 lines (12 loc) · 315 Bytes

beginner_reduce_but_grow.md

File metadata and controls

15 lines (12 loc) · 315 Bytes

Description

Given a non-empty array of integers, return the result of multiplying the values together in order. Example:

[1, 2, 3, 4] => 1 * 2 * 3 * 4 = 24

My Solution

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