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/image_overlap.rs | 35 ----------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 other/image_overlap.rs (limited to 'other/image_overlap.rs') diff --git a/other/image_overlap.rs b/other/image_overlap.rs deleted file mode 100644 index fa6fbd6..0000000 --- a/other/image_overlap.rs +++ /dev/null @@ -1,35 +0,0 @@ -impl Solution { - pub fn largest_overlap(img1: Vec>, img2: Vec>) -> i32 { - let mut ans = 0; - for i in 0..img1[0].len() { - for j in 00..img1.len() { - ans = ans.max(Solution::shift_and_compare(&img1, &img2, j, i)); - } - } - ans - } - - fn shift_and_compare(img1: &[Vec],img2: &[Vec], x_shift: usize, y_shift: usize) -> i32 { - let (mut counter, cols, rows) = ((0,0), img1.len(), img1[0].len()); - for i in 0..cols { - for j in 0..rows { - if img1[i][j] == 1 { - let ii = i + y_shift; - let jj = j + x_shift; - if ii < rows && jj < cols && img2[ii][jj] == 1 { - counter.0 += 1; - } - } - if img2[i][j] == 1 { - let ii = i + y_shift; - let jj = j + x_shift; - if ii < rows && jj < cols && img2[ii][jj] == 1 { - counter.1 += 1; - } - } - } - } - counter.0.max(counter.1) - } -} - -- cgit v1.2.3