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/set_mismatch.cpp | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 other/set_mismatch.cpp (limited to 'other/set_mismatch.cpp') diff --git a/other/set_mismatch.cpp b/other/set_mismatch.cpp deleted file mode 100644 index 8c216bc..0000000 --- a/other/set_mismatch.cpp +++ /dev/null @@ -1,19 +0,0 @@ -#include "leetcode.h" - -class Solution { -public: - vector findErrorNums(vector &nums) { - int p = 0, ac1 = 0, ac2 = 0; - for (uint i = 0; i < nums.size(); ++i) - p ^= (i + 1) ^ nums[i]; - p &= -p; - for (uint i = 0; i < nums.size(); ++i) { - ((nums[i] & p) == 0) ? ac1 ^= nums[i] : ac2 ^= nums[i]; - (((i + 1) & p) == 0) ? ac1 ^= i + 1 : ac2 ^= i + 1; - } - for (auto n : nums) - if (n == ac1) - return {ac1, ac2}; - return {ac2, ac1}; - } -}; -- cgit v1.2.3