list.zipWithIndex.foldLeft(0) { (sum, pair) =>
val (elem, index) = pair
sum + elem * elem * (length - index)
}
5
solved minimum or no use of loops in scala for Rotated Hyper-Ellipsoid Function
list.zipWithIndex.foldLeft(0) { (sum, pair) =>
val (elem, index) = pair
sum + elem * elem * (length - index)
}
5
solved minimum or no use of loops in scala for Rotated Hyper-Ellipsoid Function