You are viewing a single comment's thread. Return to all comments →
fn pangrams(s: &str) -> String { let alphabet = "abcdefghijklmnopqrstuvwxyz"; let tested: HashSet<char> = s .to_ascii_lowercase() .chars() .filter(|x| x.is_ascii_alphabetic()) .collect(); if alphabet.chars().all(|x| tested.contains(&x)) { return "pangram".into(); } "not pangram".into() }
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
Pangrams
You are viewing a single comment's thread. Return to all comments →