Rust Array Maximal Adjacement Difference
fn array_maximal_adjacent_difference(a: &[i64]) -> i64 {
let mut dif = 0;
for i in 1..a.len().saturating_sub(1) {
dif = dif.max((a[i] - a[i - 1]).abs()).max((a[i] - a[i + 1]).abs());
}
dif
}
This checks the gap between each pair of neighbors and returns the largest difference.