Deviopath › Go

Double Each Value

Easy · Slices

make([]int, len(numbers)) creates a slice of the same length, filled with zeros. Fill it by index, or append into a new slice.

Write Double(numbers) that returns a new slice where each value is multiplied by 2. Do not modify the input slice.

Next: Numbers Up To N