You are viewing a single comment's thread. Return to all comments →
Rust:
let znaki = s.chars().collect::<Vec<char>>(); let n = s.len(); let mut f = Vec::new(); let mut s = Vec::new(); for i in 0..n { if i + 1 == n {break;} f.push(((znaki[i] as i32) - znaki[i+1] as i32).abs()); s.push(((znaki[n-i-1] as i32) -znaki[n-i-2] as i32).abs()); } if f == s { return "Funny".to_string(); } "Not Funny".to_string() }
Seems like cookies are disabled on this browser, please enable them to open this website
An unexpected error occurred. Please try reloading the page. If problem persists, please contact support@hackerrank.com
Funny String
You are viewing a single comment's thread. Return to all comments →
Rust: