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/num_even_nums.cpp | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 other/num_even_nums.cpp (limited to 'other/num_even_nums.cpp') diff --git a/other/num_even_nums.cpp b/other/num_even_nums.cpp deleted file mode 100644 index 1513c72..0000000 --- a/other/num_even_nums.cpp +++ /dev/null @@ -1,29 +0,0 @@ -#include "leetcode.h" - -/* - * given array 'nums' of integers, return how - * many of them contain an even number of digits. - */ - -class Solution { -public: - int findNumbers(vector &nums) { - int ans = 0; - // use auto to identify data type & iterate through array - for (auto i : nums) - /* - * log10 returns a decimal so convert it to int - * it also returns n - 1. eg. log10(100) = 2 - * use bitwise and to check if it's odd - */ - ans += log10(i) & 1; - return ans; - } -}; - -int main() { - Solution obj; - vector nums1 = {12, 345, 2, 6, 7896}, nums2 = {555, 901, 482, 1771}; - cout << obj.findNumbers(nums1) << endl; // expect: 2 - cout << obj.findNumbers(nums2) << endl; // expect: 1 -} -- cgit v1.2.3