fn second_smallest_word_length(string: &str) -> i32 {
let arr: Vec<&str> = string.split_whitespace().collect();
if arr.len() < 2 {
return -1;
}
let mut lengths: Vec<usize> = arr.iter().map(|word| word.len()).collect();
lengths.sort();
lengths[1] as i32
}
fn main() {
let str = "c# rust c++ python javascript";
println!("{}", second_smallest_word_length(str));
}
/*
run:
3
*/