My issue
cook your dish here
for _ in range(int(input())):
n=int(input())
l=list(map(int,input().split()))
# a=0
c=0
z=0
for i in range(n):
if l[i]%2==0:
c+=(n-z)
z+=1
if z!=n:
c+=(n-z)
print(c)
whats wring with my approach or which testcase will it fail
My code
# cook your dish here
for _ in range(int(input())):
n=int(input())
l=list(map(int,input().split()))
# a=0
c=0
z=0
for i in range(n):
if l[i]%2==0:
c+=(n-z)
z+=1
if z!=n:
c+=(n-z)
print(c)
Problem Link: Optimal Flip Practice Coding Problem - CodeChef