Find the Biggest Difference in Array using java
You are given with an array, you need find the biggest difference in array. For this you need find largest and smallest element in array and subtract them you'll get the biggest difference.
Input
7
29 79 17 8 4 9 97
Output:
93
Input
7
1 2 3 4 5 6 7
Output:
6
Input
7
29 79 17 8 4 9 97
Output:
93
Input
7
1 2 3 4 5 6 7
Output:
6
Comments
Post a Comment