Probably a neater solution: sort (A.begin(), A.end()); int n = A.size(); return m


#1

Probably a neater solution:
sort (A.begin(), A.end());
int n = A.size();
return max(A[n - 1] * A[n - 2] * A[n - 3], A[n - 1] * A[0] * A[1]);


#2

Agree, it is not a efficient solution since sorting takes O(nlogn)


#3

but doesn’t matter since it get passed right ?