🎊 Python | O(nlog(n)) | Greedy | Short 🎊
For a triangle to be valid it must satisfy the triangle inequality.\n\nWe sort the array in descending order and then iterate through looking for the largest pe
For a triangle to be valid it must satisfy the triangle inequality.\n\nWe sort the array in descending order and then iterate through looking for the largest perimeter triangle in a greedy fashion.\n\n\n```\nclass Solution:\n    def largestPerimeter(self, nums: List[int]) -> int:\n        # triange in-equality a+b > c\n        # sum of 2 smallest > largest\n        nums.sort(reverse=True)\n        a,b,c = inf,inf,inf\n        for n in nums:\n            a, b, c = n, a, b\n            if a + b > c:\n                return a+b+c       \n        return 0\n         \n```
[]