From a96b65cbfad7f62f3db6b2eab105e4e25c0414c5 Mon Sep 17 00:00:00 2001 From: Jack Sangdahl Date: Fri, 27 Jun 2025 12:23:02 -0600 Subject: chore: remove old cpp and rust solutions --- other/determine_string_halves.rs | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 other/determine_string_halves.rs (limited to 'other/determine_string_halves.rs') diff --git a/other/determine_string_halves.rs b/other/determine_string_halves.rs deleted file mode 100644 index f7f4303..0000000 --- a/other/determine_string_halves.rs +++ /dev/null @@ -1,18 +0,0 @@ -use std::collections::HashSet; -struct Solution; - -impl Solution { - pub fn halves_are_alike(s: String) -> bool { - let vowels: HashSet = HashSet::from(['a','e','i','o','u','A','E','I','O','U']); - s.chars() - .enumerate() - .filter(|(_, c)| vowels.contains(c)) - .map(|(i, _)| (s.len() as i32 - 2 * (i as i32) - 1).signum()) - .sum::() == 0 - } -} - -fn main() { - let s = String::from("book"); - print!("{}", Solution::halves_are_alike(s)); -} -- cgit v1.2.3