Sobes.tech
Back to tasks
Intern — Senior
57

Поиск двух наибольших чисел в массиве

Get help with live coding in real time with Sobes Copilot
Task condition

Необходимо реализовать функцию, которая возвращает два самых больших значения из переданного массива целых чисел.

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