Easy Swift solution
Easy Swift solution\n\nclass Solution {\n    func largestPerimeter(_ A: [Int]) -> Int {\n        let a = A.sorted(by: >) // descending sort\n        for i in 0.
Easy Swift solution\n```\nclass Solution {\n    func largestPerimeter(_ A: [Int]) -> Int {\n        let a = A.sorted(by: >) // descending sort\n        for i in 0..<(a.count - 2) { // loop every 3 of lengths from large to small\n            if a[i + 1] + a[i + 2] - a[i] > 0 { // triangle is possible and non-empty\n                return a[i + 1] + a[i + 2] + a[i]\n            }\n        }\n        return 0 // there is no possible non-empty triangles\n    }\n}\n```
['Swift']