@@ -0,0 +1,1910 @@
+package year2017;%0A%0Aimport java.util.Arrays;%0Aimport java.util.List;%0Aimport java.util.regex.Pattern;%0Aimport java.util.stream.Collectors;%0A%0A/**%0A * %3Ch3%3ELargest Number%3C/h3%3E%0A * %3Cp%3EDetermine the largest number that can be formed from a group of individual numbers.%0A * For example, given the numbers 50, 2, 1, 9 the largest number that can be formed is 95021.%3C/p%3E%0A *%0A * @author John Cameron%0A * @see %3Ca href=%22https://www.seminolestate.edu/computers/competition/samples/2017%22%3EProblem Descrption and Requirements%3C/a%3E%0A */%0Apublic class LargestNumber %7B%0A%0A    public static void main(String%5B%5D args) %7B%0A%0A        /*%0A            This will read data from a file. To keep things simple, a test value is hard-coded.%0A            Exceptions do not need to be handled for this problem.%0A            //String input = new String(Files.readAllBytes(Paths.get(%22largestnumber1.txt%22)), StandardCharsets.US_ASCII);%0A        */%0A%0A        String input = %22201 3 77 5632 41 18%22;%0A%0A        List%3CInteger%3E numbers = Arrays.stream(input.trim().split(Pattern.quote(%22 %22)))%0A                .mapToInt(Integer::parseInt).boxed().collect(Collectors.toList());%0A%0A        numbers.sort((o1, o2) -%3E %7B%0A            int first1 = determineFirstDigit(o1);%0A            int first2 = determineFirstDigit(o2);%0A%0A            if (first1 == first2) %7B%0A                return o2.compareTo(o1);%0A            %7D else %7B%0A                return (first1 %3E first2) ? -1 : 1;%0A            %7D%0A        %7D);%0A%0A        System.out.println(%22Input: %22 + input);%0A%0A        System.out.println(%0A                %22Largest Number: %22 + numbers.stream().map(Object::toString).collect(Collectors.joining())%0A        );%0A%0A    %7D%0A%0A    private static int determineFirstDigit(int number) %7B%0A        if (number %3C 0)%0A            throw new IllegalArgumentException(%22Must be positive%22);%0A%0A        if (number %3C 10)%0A            return number;%0A%0A        return Character.getNumericValue(String.valueOf(number).charAt(0));%0A    %7D%0A%0A%7D%0A

Add Largest Number (2017) solution