The first step is to turn off your computer. Forget about
java. forget about all programming languages, and think about the problem.
Pretend I was going to say a bunch of numbers out loud. When I was done, you have to tell me:
the largest
the smallest
the difference between the largest and smallest.
How would you do it? You are allowed to write down any number or numbers you want, you are allowed to do computations between me giving you each number, and you are allowed to erase numbers you have written down, and replace them with new numbers.
How would YOU do it?
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors