You are viewing a single comment's thread. Return to all comments →
Rust best solution If you’re looking for solutions to the 3-month preparation kit in either Python or Rust, you can find them below: my solutions
pub fn pangrams(s: &str) -> String { //Time complexity: O(n) //Space complexity (ignoring input): O(1) let mut bit_mask = 0; for letter in s.to_lowercase().chars() { if ('a'..='z').contains(&letter) { let bit_pos = letter as u32 - 'a' as u32; bit_mask |= 1 << bit_pos; }; } if bit_mask == (1 << 26) - 1 { return "pangram".to_string(); }; "not pangram".to_string() }
Seems like cookies are disabled on this browser, please enable them to open this website
Pangrams
You are viewing a single comment's thread. Return to all comments →
Rust best solution
If you’re looking for solutions to the 3-month preparation kit in either Python or Rust, you can find them below: my solutions