fn convert_array_of_integers_to_string(arr: &[i32]) -> String {
let mut result = String::new();
for &num in arr {
result.push_str(&num.to_string());
result.push(' ');
}
result.trim_end().to_string() // Remove the trailing space
}
fn main() {
let arr = [5, 8, 12, 800, 3907];
let s = convert_array_of_integers_to_string(&arr);
println!("{}", s);
}
/*
run:
5 8 12 800 3907
*/