Ruby | 1-liner
ruby\ndef largest_perimeter(nums)\n    nums.sort!.reverse.each_cons(3) { |a, b, c| return a + b + c if a < b + c } && 0\nend\n\n\n\n# Tests:\nruby\nrequire \'te
```ruby\ndef largest_perimeter(nums)\n    nums.sort!.reverse.each_cons(3) { |a, b, c| return a + b + c if a < b + c } && 0\nend\n```\n<hr>\n\n# Tests:\n```ruby\nrequire \'test/unit\'\nclass Test_largest_perimeter < Test::Unit::TestCase\n    def test_\n        assert_equal 5, largest_perimeter([2,1,2])\n        assert_equal 0, largest_perimeter([1,2,1])\n    end\nend\n```\n\n
['Ruby']