find the maximum profit in stock market