public class Solution {

public int solve(ArrayList A) {

int n=A.size();

```
for(int i=0;i<n;i++){
int count=0;
int lefteven=0,leftodd=0;
for(int j=0;j<i;j++){
if(j%2==0){
lefteven+=A.get(j);
}else{
leftodd+=A.get(j);
}
}
int rightodd=0,righteven=0;
for(int k=i+1;k<n;k++){
if(k%2==0){
rightodd+=A.get(k);
}else{
righteven+=A.get(k);
}
}
if((lefteven+rightodd)==(leftodd+righteven)){
count++;
}
return count;
}
return -1;
}
```

}