3917. Count Indices With Opposite Parity
You are given an integer array
numsof lengthn.The score of an index
iis defined as the number of indicesjsuch that:
i < j < n, andnums[i]andnums[j]have different parity (one is even and the other is odd).Return an integer array
answerof lengthn, whereanswer[i]is the score of indexi.
1 | class Solution { |