problem link
this is showing the error…
Line 44: Char 50: runtime error: signed integer overflow: -1094795586 + -1094795585 cannot be represented in type ‘int’ (solution.cpp)
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior prog_joined.cpp:53:50
plz correct my code along with explaination…also modify the code to handle cases where there are 0 in array.