1 2 3 4 5 6 7 8 9 10 11
fn main() { println!("Hello, world!"); } struct Solution; impl Solution { pub fn first_palindrome(words: Vec<String>) -> String { words.iter().find(|&s| s.chars().take(s.len() / 2).eq(s.chars().rev().take(s.len() / 2))).map(|x| x.clone()).unwrap_or(String::new()) } }