Correct answer on custom input but wrong on submission


#1

for the following test case my answer is 470 in custom input but 430 when i m submitting the code

8 10 20 29 84 4 32 60 86 8 7 37 77 69 85 83 81 78 22 45 43 63 60 21 0 94 59 88 9 54 30 80 40 78 52 58 26 84 47 0 24 60 40 17 69 5 38 5 75 59 35 26 64 41 85 22 44 25 3 63 33 13 2 21 39 51 75 70 76 57 56 22 31 45 47 100 65 10 94 96 81 14


#2

I also faced the same issue in a different problem on interviewbit. Turned out that the issue occurred beacause I was using global variables. Interviewbit discourages the use of global variables for some strange reason.