It is very similar to editorial but not working


#1

please help here ,my code is not working while the editorial is i can’t detect any differences please. it is very similar.
`int Solution::threeSumClosest(vector &A, int B) {
int size = A.size();
int close = INT_MAX;
sort(A.begin(), A.end());
int s,e;

for(int i= 0; i< size-2; i++){
    int sum = 0;
    s = i+1;
    e = size-1;
    while( s<e){
        sum = A[i] + A[s] + A[e];
        if( abs(sum - B) < abs(close - B)){
            close = sum;
        }
        if (sum <= B) { 
            s++;
        }  
        else{
            e--;
        }
    }
}
return close;

}`