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/equal_row_col_pair.cpp | 34 ---------------------------------- 1 file changed, 34 deletions(-) delete mode 100644 other/equal_row_col_pair.cpp (limited to 'other/equal_row_col_pair.cpp') diff --git a/other/equal_row_col_pair.cpp b/other/equal_row_col_pair.cpp deleted file mode 100644 index 426291c..0000000 --- a/other/equal_row_col_pair.cpp +++ /dev/null @@ -1,34 +0,0 @@ -// 2352. Equal Row and Column Pairs -#include "leetcode.h" - -/* - * given a 0-indexed n x n integer matrix 'grid', return the number of pairs - * (ri, cj) such that row 'ri' and column 'ci' are equal. a row and column pair - * is considered equal if they contain the same elements in the same order (ie. - * an equal array) - */ - -class Solution { -public: - int equalPairs(vvd & grid) { - int ans = 0; - map, int> mv; - for (int i = 0; i < grid.size(); i++) - mv[grid[i]]++; - for (int i = 0; i < grid[0].size(); i++) { - vector v; - for (int j = 0; j < grid.size(); j++) - v.push_back(grid[j][i]); - ans += mv[v]; - } - return ans; - } -}; - -int main() { - Solution obj; - vvd g1 = {{3, 2, 1}, {1, 7, 6}, {2, 7, 7}}; - vvd g2 = {{3, 1, 2, 2}, {1, 4, 4, 5}, {2, 4, 2, 2}, {2, 4, 2, 2}}; - printf("%d\n", obj.equalPairs(g1)); // expect: 1 - printf("%d\n", obj.equalPairs(g2)); // expect: 3 -} -- cgit v1.2.3