
Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
After replacing each even by zero and every odd by one can we use prefix sum to find answer ?
Can we use two pointers to count number of sub-arrays ?
Can we store the indices of odd numbers and for each k indices count the number of sub-arrays that contains them ?