For this, the method used is to iterate though the array with a for loop and collect the max and min.
See the attached file for an example.
X. XXX number of XXX XXX XXXX inputs
XXXXX iterating XXXXXXX XXX array you can also XXXXXXX XXXXX values by have XXX XXXXXXXX XXXXXX 'odd' XXX 'XXXX'. XXXX you get a XXXXXX that is XXX, you add one XX the the 'odd' variable. To XXX XX a value XX XXX or XXXX, you get the XXXXXXXXX XX XXX XXXXX XXXX divided by XXX. XXX example, XX % 2 == X XXXXXXX XXXX it XX even. XXXX, 3 % X == X which means that XX is odd.
3. XXXXXXXXXX XXXXXX. If XXX XXXXX XX 1 X 2 9, the program XXXXXX 1 X XX XX.
XX print XXX XXX of the XXXXXXXX, you XXX XXXXXXX through the XXXXXXXX XXXXX XXX value XX the end of XXXX iteration.
4. XXX adjacent duplicates. If the XXXXX is 1 X X 4 5 X 6 6 X 2, XXX output XX X X X. XXXXX XXX those XXX account for XXXXXXXX adjacent numbers like 6 6 6.
For XXXX, you find XX the current XXXXXX XXX the number XXXXX it equal the XXXX. XX they XX, then add them to an array.
Again, see XXX attachment XXX a XXXXXX and more visual explanation.