Sobes.tech
Intern — Senior

Finding the two largest numbers in an array

livecode

Task condition

It is necessary to implement a function that returns the two largest values from a given array of integers.

private static int[] getTwoMax(int[] arr) {
    // return the maximum two numbers from an array of numbers, e.g. [firstMax, secondMax]
    return new int[0];
}