diff options
Diffstat (limited to 'other/check_pangram_sentence.rs')
-rw-r--r-- | other/check_pangram_sentence.rs | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/other/check_pangram_sentence.rs b/other/check_pangram_sentence.rs deleted file mode 100644 index 0f69c31..0000000 --- a/other/check_pangram_sentence.rs +++ /dev/null @@ -1,21 +0,0 @@ -struct Solution; - -impl Solution { - pub fn check_if_pangram(sentence: String) -> bool { - let mut bit_mask: u32 = 0; - let mut count = 0; - for c in sentence.chars() { - let idx = c as usize - 'a' as usize; - if bit_mask & (1 << idx) == 0 { - count += 1; - } - bit_mask |= 1 << idx; - } - count == 26 - } -} - -fn main() { - let sentence = String::from("thequickbrownfoxjumpsoverthelazydog"); - print!("{}", Solution::check_if_pangram(sentence)); -} |