https://hack.codingblocks.com/contests/c/509/217
https://ide.codingblocks.com/s/33524
Cant pass 2 test cases.please tell the error
https://hack.codingblocks.com/contests/c/509/217
https://ide.codingblocks.com/s/33524
Cant pass 2 test cases.please tell the error
Your code will fail for large cases, or in other words for n>10.
For eg
INPUT:
11
1 1 1 1 1 1 3 5 2 9 9
4
3 9 4 3
OUTPUT:
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, END
Which is obviously incorrect.
This is because you are making the number by making use of power function. The number is so large that it can not be stored in an integer and this produces unexpected results.
Try a different approach, like you do on pen and paper. Add units place digits, take the carry, and add tens place digits, and so on.