Challenge 2 - Maximize stock trading profit
Given the daily values of a stock, create a function called maxProfitDays() that, given a list of integers, will return the index value of the two elements that represent the day on which one should have bought a share and the day on which one should have sold a share based on the max profit.
A list of integers will represent the stock price at the beginning of each day for a week. You are required to buy and sell only once. You also must buy a stock before selling it.
For example, given the list [17, 11, 60, 25, 150, 75, 31, 120], you can assume that index 0 represents day 0 and index 7 represents day 7. In this case, purchasing on day 1 and selling on day 4 would yield the most profit.
Input:
Output: