Different ways of creating a multiplication grid in ruby
return from function anti-pattern

For the second example, doing

x = computation()
x


In a function is an anti-pattern, you should return the result directly:

computation()


It is more common and easier for the same result.

No Array

The first function does not need an array, just append to the string directly.