arr = [1, 2, 3, 4, 5] result = arr.select(&:even?).map { |x| x**2 } puts result.join(',')
arr = [1, 2, 3, 4, 5] result = arr.reduce { |product, x| product * x } puts result
arr = [1, 2, 3, 4, 5] result = arr.reverse_each.take(3) puts result.join(',')
arr = [1, 2, 3, 4, 5] result = arr.drop(2).cycle(2).to_a puts result.join(',')