Sum without highest and lowest number

2017/12/27 posted in  codeWars

int sum(int* numbers, int numbersCount)
{
    if(numbersCount<=1) return 0;
    int min = INT_MAX;
    int max = INT_MIN;
    int sum = 0;
    for (int i = 0; i<numbersCount; i++)
    {
        if(numbers[i]>max) max = numbers[i];
        if(numbers[i]<min) min = numbers[i];
        sum+= numbers[i];
    }
    return sum-min-max;
}