DSA: Arrays
1. Best Score: Given an array, write a function to get first, second best scores from the array and return it in new array. myArray = { 84 , 85 , 86 , 87 , 85 , 90 , 85 , 83 , 23 , 45 , 84 , 1 , 2 , 0 } firstSecond ( myArray ) // {90, 87} package test; import java.util.Arrays; public class Main { public static void main (String[] args) { int [] arr = { 5 , 91 , 15 , 3 , 90 , 8 , 79 , 91 , 13 }; System. out .println(Arrays. toString ( findTopTwoScores (arr))); } public static int [] findTopTwoScores ( int [] array) { int [] result = new int [ 2 ]; int first = array[ 0 ]; int second = first; for ( int i = 1 ; i < array. length ; i++) { if (array[i] > first) { second = first; first = array[i]; } else if (array[i] > second && array[i] < first) { second = array[i]; } } result[ 0 ] = first; re...