use std::io::*; use std::str::FromStr; fn main() { let s: Vec = read_array(); for _i in 0..s.len() - 1{ if s[_i] == s[_i + 1]{ continue; } print!("{}",s[_i]); } if s[s.len() - 2] != s[s.len() - 1]{ print!("{}",s[s.len() - 1]); } if s[s.len() - 2] == s[s.len() - 1]{ print!("{}",s[s.len() - 1]); } } pub fn read() -> T { let stdin = stdin(); let stdin = stdin.lock(); let token: String = stdin .bytes() .map(|c| c.expect("failed to read char") as char) .skip_while(|c| c.is_whitespace()) .take_while(|c| !c.is_whitespace()) .collect(); token.parse().ok().expect("failed to parse token") } pub fn read_array() -> Vec { let array: String = read(); let chars: Vec = array.trim().chars().collect::>(); chars }