11 lines
183 B
Go
11 lines
183 B
Go
package wrong
|
|
|
|
import "golang.org/x/exp/constraints"
|
|
|
|
func Scale[E constraints.Integer](s []E, c E) []E {
|
|
r := make([]E, len(s))
|
|
for i, v := range s {
|
|
r[i] = v * c
|
|
}
|
|
return r
|
|
}
|