I am getting 7 as the answer which is incorrect but if I run the same code in local compiler I get the correct answer as 22 . There is something wrong with this compiler. Kindly do something for this.
This compiler is giving wrong answer
this should not happen
if it is happening then try after changing this line (line 34)
a[i] = (-a[i]); change it to
a[i] = -1*a[i];
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.
@sb1251224_6919c19fccd96630
your code was fine… just give newline after every test case… It will pass all test cases…
corrected code -->
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.