Priority Q is overkill, follow this soln (C++ with comments)


#1
int Solution::maxp3(vector<int> &A) {
    sort(A.begin(),A.end());
    return max(A[0]*A[1]*A[A.size()-1],A[A.size()-1]*A[A.size()-2]*A[A.size()-3]);
    // You can either pick 2-ve 1+ve(max no.) or last 3 max +ve numbers
    // -70 -50 -1 0 3 100 -> max(350000, 0)
}

That’s all over lol