const N: usize = 50;

fn schwefel(solution: &[f64; N]) -> f64 {
    return 418.9829_f64 * N as f64
        + solution.iter().fold(0_f64, |sum, x| sum + x * x.abs().sqrt().sin());
}

fn main() {
    println!("Hello, world!");
}

fn schwefel(solution: &Vec<f64>) -> f64 {
    return 418.9829_f64 * solution.len() as f64
        + solution.iter().fold(0_f64, |sum, x| sum + x * x.abs().sqrt().sin());
}

fn main() {
    println!("Hello, world!");
}

--- 
+++ 
@@ -1,7 +1,5 @@
-const N: usize = 50;
-
-fn schwefel(solution: &[f64; N]) -> f64 {
-    return 418.9829_f64 * N as f64
+fn schwefel(solution: &Vec<f64>) -> f64 {
+    return 418.9829_f64 * solution.len() as f64
         + solution.iter().fold(0_f64, |sum, x| sum + x * x.abs().sqrt().sin());
 }
 
Swap Vec<f64> with [f64, N]
