You are viewing a single comment's thread. Return to all comments →
vector<int> compareTriplets(vector<int> a, vector<int> b) { int al = 0, bo = 0; al += a[0] > b[0]; bo += b[0] > a[0]; al += a[1] > b[1]; bo += b[1] > a[1]; al += a[2] > b[2]; bo += b[2] > a[2]; return {al, bo}; }
Seems like cookies are disabled on this browser, please enable them to open this website
Compare the Triplets
You are viewing a single comment's thread. Return to all comments →
In C++
Best solution
In O(1)