From 6040b3154734255236ee5bae5cb8f1d89645a263 Mon Sep 17 00:00:00 2001 From: MAHESH ADDAGATLA <158994925+Mahesh-addagatla@users.noreply.github.com> Date: Fri, 20 Dec 2024 22:46:47 +0530 Subject: [PATCH] Create 976. Largest Perimeter Triangle.java --- 976. Largest Perimeter Triangle.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 976. Largest Perimeter Triangle.java diff --git a/976. Largest Perimeter Triangle.java b/976. Largest Perimeter Triangle.java new file mode 100644 index 0000000..716044c --- /dev/null +++ b/976. Largest Perimeter Triangle.java @@ -0,0 +1,12 @@ +class Solution { + public int largestPerimeter(int[] nums) { + int n=nums.length; + Arrays.sort(nums); + for(int i=n-1;i>=2;i--){ + if(nums[i]