[Java/C++/Python] Sort and Try Biggest
For a >= b >= c, a,b,c can form a triangle if a < b + c.\n\n1. We sort the A\n2. Try to get a triangle with 3 biggest numbers.\n3. If A[n-1] < A[n-2] + A[n-3], 
For `a >= b >= c`, `a,b,c` can form a triangle if `a < b + c`.\n\n1. We sort the `A`\n2. Try to get a triangle with 3 biggest numbers.\n3. If `A[n-1] < A[n-2] + A[n-3]`, we get a triangle.\n   If `A[n-1] >= A[n-2] + A[n-3] >= A[i] + A[j]`, we cannot get any triangle with `A[n-1]`\n4. repeat step2 and step3 with the left numbers.\n\n\n**Java:**\n```\n    public int largestPerimeter(int[] A) {\n        Arrays.sort(A);\n        for (int i = A.length - 1; i > 1; --i)\n            if (A[i] < A[i - 1] + A[i - 2])\n                return A[i] + A[i - 1] + A[i - 2];\n        return 0;\n    }\n```\n\n**C++:**\n```\n    int largestPerimeter(vector<int>& A) {\n        sort(A.begin(), A.end());\n        for (int i = A.size() - 1 ; i > 1; --i)\n            if (A[i] < A[i - 1] + A[i - 2])\n                return A[i] + A[i - 1] + A[i - 2];\n        return 0;\n    }\n```\n\n**Python:**\n```\n    def largestPerimeter(self, A):\n        A = sorted(A)[::-1]\n        for i in range(len(A) - 2):\n            if A[i] < A[i + 1] + A[i + 2]:\n                return A[i] + A[i + 1] + A[i + 2]\n        return 0\n```\n
[]