Ad
  • Default User Avatar

    Sorry, I seemed to have missed an email detailing this comment.
    Your solution is close but realize that Array.map will return an array with the block executed on each element of the array!
    So you should be making sure to return the sum would be a good idea.

  • Default User Avatar

    .each will only allow 1 parameter for the block so you cannot do: numbers.each {|total, i| total += i}
    You can do numbers.each { |i| total += i } but you'll need total be done in some other way.