Test cases weak or question must include that all numbers must be positive


#1

my code with custom input 2 2 -1 -3 -2 -4 gives result 0, however answer should be -1, but the same code passses all submission test cases
int Solution::adjacent(vector<vector > &A)
{
int n = A[0].size();
int arr[n];
for (int i = 0; i < n; i++)
arr[i] = max(A[0][i], A[1][i]);
int dp[n][2];
dp[0][0] = 0;
dp[0][1] = arr[0];
for (int i = 1; i < n; i++)
{
dp[i][0] = max(dp[i - 1][1], dp[i - 1][0]);
dp[i][1] = dp[i - 1][0] + arr[i];
// cout << dp[i][0] << dp[i][1] << endl;
}
return max(dp[n - 1][0], dp[n - 1][1]);
}