Getting WA in BTAR

I did the exact same thing explained in the tutorial. It’s passing the sample test cases but giving WA when submitted.Please help!


My solution

for testcase



2 2 4 6 3 1

Correct Output:-1

Your Code’s Output:2

Why don’t you find the sum of all elements first and then check whether it is divisible by 4 or not rather than checking every time

I made few adjustments to your