Generation

generate functionSun, 13 Nov 2022

add two to all number in a list returning a newly allocated list

def add_two(list) return list.map { |x| x+2 } end add_two([1, 2, 3])

Want to kickstart your project?Use the new AI Studio to create your code