I'm trying to return the largest and the smallest numbers in an array as an array
for example:
int[] arr = {5, 1, 2, 4, 9, 10, 200}
public static int[] largest_smallest(int[] arr)
{
int max = array_values.Max();
int min = array_values.Min();
//return array with largest and smallest numbers
}
How do I modify my code so it can have an output of: [200, 1]
?