Y DO I NEED TO PUT COMMAS IN MY OUTPUT THEY JUST WANTED THE SUM
hello @dhruv.mahajan.mait

because in output format they want comma.
if u dont print commas in between then checker will think that u output is wrong and it will give WA verdict
so do i need to make another array which accounts for the sum ?
yeah store each digits of ur answer in array and print them by seprating with common.
also dont try to store answer in any variable becuase answer can be vary big and we dont have any datatype that can accomodate very big number.
here is the complete approach ->
just do simple addition , that we use to do in our daily life.
i.e first add last digits of given numbers and forward its carray to left , again perform addition on next digits and forward their carray to next . repeat this for all digits thats it.
Algorithm:
1.Traverse both the arrays simultaneously from the end until we reach the 0th index of either of the array.
2.While traversing each element of array, add an element from both arrays and carry from the previous sum.
…………2.1 Store the unit digit of the sum(obtained by doing - sum%10) in the ans array.
…………2.2 forward carry(obtained by doing - sum/10) for the next index sum.
3.After the loop ends we are left with one of the arrays and the carry.
4.We will now repeat step 2 but now for one array which is left after the loop.
5.If carry !=0 then store the carry in the 0th index of ans array.
6.Print the ans array .