pair<long long, long long> getMinMax(long long a[], int n) {
    
    pair<long long,long long> p;
    p.first=a[0];   // min
    p.second=a[0];  //max
    
    for(auto x:a)
    // for(int i=0; i<n;i++)
    {
        // long long x=a[i];
        if(x<p.first)
            p.first=x;
        if(x>p.second)
            p.second=x;
    }
    return p;
}
WROTE THIS CODE
it shows error on for(auto x:a);
what is wrong with that , please explain;
 
     
    