package hackerrank;

import java.util.Scanner;

/**
 * https://www.hackerrank.com/challenges/maximum-perimeter-triangle
 */
public class MaximumPerimeterTriangle {
    private static void maxPerimeterTriangle(int[] array) {
        // TODO
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[] array = new int[n];
        for (int i = 0; i < n; i++) {
            array[i] = in.nextInt();
        }
        maxPerimeterTriangle(array);
    }
}

@@ -14,16 +14,41 @@
 rrank;%0A%0A
+import java.util.Arrays;%0A
 import j
@@ -65,16 +65,16 @@
 canner;%0A
-
 %0A/**%0A * 
@@ -254,15 +254,281 @@
     
-// TODO
+Arrays.sort(array);%0A        int a = array%5B0%5D;%0A        int b = array%5B1%5D;%0A        int c = array%5Barray.length - 1%5D;%0A        // TODO%0A        if (a + b %3E c) %7B%0A            System.out.println(a + %22 %22 + b + %22 %22 + c);%0A        %7D else %7B%0A            System.out.println(%22-1%22);%0A        %7D
 %0A   

Update Maximum Perimeter Triangle