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/max_len_concat_str.rs | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 other/max_len_concat_str.rs (limited to 'other/max_len_concat_str.rs') diff --git a/other/max_len_concat_str.rs b/other/max_len_concat_str.rs deleted file mode 100644 index 8ce0c2b..0000000 --- a/other/max_len_concat_str.rs +++ /dev/null @@ -1,29 +0,0 @@ -struct Solution; - -impl Solution { - pub fn max_length(arr: Vec) -> i32 { - let mut ans: u32 = 0; - let mut unique: Vec = Vec::new(); - for s in arr { - let bin: u32 = s.bytes().map(|c| 1 << (c - b'a')).sum(); - if bin.count_ones() == s.len() as u32 { - unique.push(bin); - } - } - let mut concat: Vec = vec![0]; - for u in unique { - for i in 0..concat.len() { - if (concat[i] & u).count_ones() == 0 { - concat.push(concat[i] | u); - ans = ans.max(concat[i].count_ones() + u.count_ones()); - } - } - } - ans as i32 - } -} - -fn main() { - let arr = vec!["un".to_string(),"iq".to_string(),"ue".to_string()]; - print!("{}", Solution::max_length(arr)); -} -- cgit v1.2.3