Segmentation fault in test button but right answer in custom input


#1

Runtime Error. Your submission stopped because of a runtime error. ex: division by zero, array index out of bounds, uncaught exception You can try testing your code with custom input and try putting debug statements in your code.
Segmentation fault
Your submission encountered runtime error for the following input:
A : [ 95 -> 84 -> 40 -> 77 -> 57 -> 35 -> 84 -> 45 -> 17 -> 3 -> 1 -> 98 -> 5 -> 38 -> 59 -> 73 -> 97 -> 46 -> 4 -> 38 -> 73 -> 27 -> 49 -> 45 -> 80 -> 99 -> 98 -> 10 -> 20 -> 46 -> 29 -> 85 -> 43 -> 13 -> 99 -> 12 -> 20 -> 71 -> 79 -> 1 -> 1 -> 57 -> 31 -> 78 -> 59 -> 16 -> 11 -> 7 ]
The expected output for this testcase is:
-88 -> -73 -> -24 -> -18 -> 21 -> -4 -> -27 -> -44 -> -16 -> 76 -> 70 -> -78 -> 7 -> 61 -> -46 ->…

custom input:

Your input:
A : [ 95 -> 84 -> 40 -> 77 -> 57 -> 35 -> 84 -> 45 -> 17 -> 3 -> 1 -> 98 -> 5 -> 38 -> 59 -> 73 -> 97 -> 46 -> 4 -> 38 -> 73 -> 27 -> 49 -> 45 -> 80 -> 99 -> 98 -> 10 -> 20 -> 46 -> 29 -> 85 -> 43 -> 13 -> 99 -> 12 -> 20 -> 71 -> 79 -> 1 -> 1 -> 57 -> 31 -> 78 -> 59 -> 16 -> 11 -> 7 ]
Your function returned the following output:
-88 -> -73 -> -24 -> -18 -> 21 -> -4 -> -27 -> -44 -> -16 -> 76 -> 70 -> -78 -> 7 -> 61 -> -46 ->…

anshuman plz look into this matter