Tap here to switch tabs
Problem
Submissions

Problem: Number of Subarrays Having Even Product

med
30 min
Try to solve the Number of Subarrays Having Even Product problem.

Statement

Given an array of integers nums, return the total number of subarrays where the product of all elements is an even number.

A subarray is a contiguous non empty sequence of elements within an array.

Constraints:

  • 1≤1 \leq nums.length ≤105\leq 10^5

  • 1≤1 \leq nums[i] ≤105\leq 10^5

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Number of Subarrays Having Even Product

med
30 min
Try to solve the Number of Subarrays Having Even Product problem.

Statement

Given an array of integers nums, return the total number of subarrays where the product of all elements is an even number.

A subarray is a contiguous non empty sequence of elements within an array.

Constraints:

  • 1≤1 \leq nums.length ≤105\leq 10^5

  • 1≤1 \leq nums[i] ≤105\leq 10^5