Tap here to switch tabs
Problem
Submissions

Problem: Number of Sub-arrays With Odd Sum

med
30 min
Try to solve the Number of Sub-arrays With Odd Sum problem.

Statement

Given an array of integers arr, return the total number of subarrays with an odd sum.

Since the answer can be large, return it modulo 109+710^9 + 7.

Constraints:

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

  • 1≤1 \leq arr[i] ≤100\leq 100

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Number of Sub-arrays With Odd Sum

med
30 min
Try to solve the Number of Sub-arrays With Odd Sum problem.

Statement

Given an array of integers arr, return the total number of subarrays with an odd sum.

Since the answer can be large, return it modulo 109+710^9 + 7.

Constraints:

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

  • 1≤1 \leq arr[i] ≤100\leq 100