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.
Maximum Perimeter Triangle
Maximum Perimeter Triangle
Sort by
recency
|
316 Discussions
|
Please Login in order to post a comment
Haskell
Here is my c++ solution, you can watch the explanation here : https://youtu.be/cP4PLTgC1OE
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;
}