Generation

generate functionSun, 13 Nov 2022

Replace top 5 integers in array with 0

func replace_top_five(arr []int) []int { for i, v := range arr { if i < 5 { arr[i] = 0 } } return arr }

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