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/longest_common_subseq.rs | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 other/longest_common_subseq.rs (limited to 'other/longest_common_subseq.rs') diff --git a/other/longest_common_subseq.rs b/other/longest_common_subseq.rs deleted file mode 100644 index 212070a..0000000 --- a/other/longest_common_subseq.rs +++ /dev/null @@ -1,23 +0,0 @@ -struct Solution; - -impl Solution { - pub fn longest_common_subsequence(text1: String, text2: String) -> i32 { - let mut dp: Vec> = vec![vec![0; text2.len() + 1]; text1.len() + 1]; - for (i, c1) in text1.chars().enumerate() { - for (j, c2) in text2.chars().enumerate() { - dp[i + 1][j + 1] = if c1 == c2 { - dp[i][j] + 1 - } else { - std::cmp::max(dp[i][j + 1], dp[i + 1][j]) - } - } - } - dp[text1.len()][text2.len()] as i32 - } -} - -fn main() { - let text1 = String::from("abcde"); - let text2 = String::from("ace"); - print!("{}", Solution::longest_common_subsequence(text1, text2)); //3 -} -- cgit v1.2.3