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_zero_filled_subarr.cpp | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 other/num_zero_filled_subarr.cpp (limited to 'other/num_zero_filled_subarr.cpp') diff --git a/other/num_zero_filled_subarr.cpp b/other/num_zero_filled_subarr.cpp deleted file mode 100644 index 8ba45f3..0000000 --- a/other/num_zero_filled_subarr.cpp +++ /dev/null @@ -1,29 +0,0 @@ -// 2348. Number of Zero-Filled Subarrays -#include "leetcode.h" - -// given integer array 'nums', return number of subarrays filled with zero. a -// subarray is a contiguous non-empty sequence of elements from within an array - -class Solution { -public: - long long zeroFilledSubarray(vector &nums) { - long long ans = 0; - short n = nums.size(); - for (int i = 0, j = 0; i < n; ++i) { - if (nums[i] != 0) - j = i + 1; - ans += i - j + 1; - } - return ans; - } -}; - -int main() { - Solution obj; - vector n1 = {1, 3, 0, 0, 2, 0, 0, 4}; - vector n2 = {0, 0, 0, 2, 0, 0}; - vector n3 = {2, 10, 2019}; - printf("%lld\n", obj.zeroFilledSubarray(n1)); // expect: 6 - printf("%lld\n", obj.zeroFilledSubarray(n2)); // expect: 9 - printf("%lld\n", obj.zeroFilledSubarray(n3)); // expect: 0 -} -- cgit v1.2.3