C 5(+2) lines, O(n log n) solution use qsort
\nbool comp(void*a,void*b){\n    return *(int*)a > *(int*)b;\n}\n\nint largestPerimeter(int* nums, int numsSize){\n    qsort(nums, numsSize, sizeof(int), comp);
```\nbool comp(void*a,void*b){\n    return *(int*)a > *(int*)b;\n}\n\nint largestPerimeter(int* nums, int numsSize){\n    qsort(nums, numsSize, sizeof(int), comp);\n    for(int i=numsSize-3;i>=0;i--){\n        if(nums[i]+nums[i+1]>nums[i+2]){\n            return nums[i]+nums[i+1]+nums[i+2];\n        }\n    }\n    return 0;\n}\n```
['C', 'Sorting']