It says wrong answer and giving wrong output when I am pressing the test button but when I am putting the same input as custom test case it is giving the right output.Any idea why this is happening and how to resolve it?


The above test case is giving output 1 when I am pressing the submit or test button but it is showing the correct output that is 1 when I am giving it as a custom test case input


I was also facing same issue.
Instead of using dp global array, I passed dp array as reference in function.