Hard
Biggest Rise
Read daily prices. Find the biggest profit from buying on one day and selling on a later day. Print 0 if no profit is possible.
Input
One line of integers.
Output
The best profit.
Sample 1
Input
7 1 5 3 6 4
Output
5
Sample 2
Input
7 6 4 3 1
Output
0
Output appears hereHints