Write a function that accepts an array of integers and returns the second largest integer in the array. Return -1 if there is no second largest.
The signature of the function is
public class bc
{
public static void main(String[] args){ }
int f(int[ ] a) { }
}
Examples:
if the input array is {1, 2, 3, 4} return 3
if the input array is {{4, 1, 2, 3}} return 3
if the input array is {1, 1, 2, 2} return 1
if the input array is {1, 1} return -1
if the input array is {1} return -1
if the input array is {} return -1
bc.java (Required code)