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/diff_two_array.cpp | 35 ----------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 other/diff_two_array.cpp (limited to 'other/diff_two_array.cpp') diff --git a/other/diff_two_array.cpp b/other/diff_two_array.cpp deleted file mode 100644 index 6695ae7..0000000 --- a/other/diff_two_array.cpp +++ /dev/null @@ -1,35 +0,0 @@ -// 2215. Find the Difference of Two Arrays -#include "leetcode.h" - -/* - * given two zero-indexed arrays 'n1' and 'n2', return a list - * 'ans' of size 2 where: - * 'ans[0]' is a list of all distinct integers in 'n1' which - * are not present in 'n2' - * 'ans[1]' is a list of all distinct integers in 'n2' which - * are not present in 'n1' - * note that the integers in the lists may be returned in any order - */ - -class Solution { -public: - vvd findDifference(vector &n1, vector &n2) { - unordered_set us1(begin(n1), end(n1)), us2(begin(n2), end(n2)); - vvd ans(2); - for (int i : us1) - if (!us2.count(i)) - ans[0].push_back(i); - for (int i : us2) - if (!us1.count(i)) - ans[1].push_back(i); - return ans; - } -}; - -int main() { - Solution obj; - vector n11 = {1, 2, 3}, n21 = {2, 4, 6}; - vector n12 = {1, 2, 3, 3}, n22 = {1, 1, 2, 2}; - vvd fd1 = obj.findDifference(n11, n21); - vvd fd2 = obj.findDifference(n12, n22); -} -- cgit v1.2.3