my_array = [1, 2, 3, 4, 5]

The problem is to multiply each number by itself

And gives this as a template

numbers = [5, 2, 8]

sum = 0

numbers.each do |n|

sum += n

end

puts sum

```
After an hour I finally just looked up the answer
Replace this line with your code.
my_array = [1, 2, 3, 4, 5]
my_array.each do |x|
x = x**2
puts x
end
```

Using the format provided, how the heck was I supposed to know to use the do function? I have seen other ways of solving the problem, but none of them match the format given as an outline above. I am wondering how I could have known to solve this using the format provided.

In all the solutions I found, none followed this format. And the hint given is: object.method { |placeholder| action }

This does not even pertain to the above answer, which does not have the "action". I am wondering if this is poor layout on Code Academy's part, or just me.