Rust Adjacent Elements Product
fn adjacent_elements_product(input_array: &[i64]) -> i64 {
input_array
.windows(2)
.map(|w| w[0] * w[1])
.max()
.unwrap_or(i64::MIN)
}
This walks through neighboring values, multiplies each pair, and keeps the biggest product it finds.