text: # Approach 1 - Sort
  
  # Time: O(N log N)
  # Space: O(1)
  
  class Solution:
      def largestPerimeter(self, nums: List[int]) -> int:
          nums.sort()
          
          for i in range(len(nums) - 3, -1, -1):
              if nums[i] + nums[i + 1] > nums[i + 2]:
                  return nums[i] + nums[i + 1] + nums[i + 2]
          
          return 0