Use the reduce method to calculate the sum of the squares of the array elements using the shortest notation. Swift

后端 未结 0 481
小鲜肉
小鲜肉 2021-01-14 01:38

let array = [2,5,3]

let newArray = [4,5,9]

// answer is 18

Use only reduce method

相关标签:
回答
  • 消灭零回复
提交回复
热议问题