We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
/*
* Complete the 'maximumPerimeterTriangle' function below.
*
* The function is expected to return an INTEGER_ARRAY.
* The function accepts INTEGER_ARRAY sticks as parameter.
*/
vector maximumPerimeterTriangle(vector sticks) {
int a=-1,b=-1,c=-1;
sort(sticks.begin(),sticks.end(),greater());
int n=sticks.size();
for(int i=0;i
Maximum Perimeter Triangle
You are viewing a single comment's thread. Return to all comments →
include
using namespace std;
string ltrim(const string &); string rtrim(const string &); vector split(const string &);
/* * Complete the 'maximumPerimeterTriangle' function below. * * The function is expected to return an INTEGER_ARRAY. * The function accepts INTEGER_ARRAY sticks as parameter. */
vector maximumPerimeterTriangle(vector sticks) { int a=-1,b=-1,c=-1; sort(sticks.begin(),sticks.end(),greater()); int n=sticks.size(); for(int i=0;i
} if(a!=-1) return {c,b,a}; return {-1}; }
int main() { ofstream fout(getenv("OUTPUT_PATH"));
}
string ltrim(const string &str) { string s(str);
}
string rtrim(const string &str) { string s(str);
}
vector split(const string &str) { vector tokens;
}