Sum the deltas by jennamagius

use std::io::*;fn main() {let a = stdin();for b in a.lock().lines(){let b = b.unwrap();let c = b.chars().skip(1).take(b.len()-2).collect::<String>().split(",").map(|x| x.trim().parse::<i32>().unwrap()).collect::<Vec<i32>>();println!("{}",c.iter().enumerate().take(c.len()-1).map(|(k,&v)| c[k+1]-v).fold(0, std::ops::Add::add));}}

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page