def stock_prices_1_brute_force(stock_prices):
	"""
	Solution: Brute force iterative solution compares each stock price with
	all subsequent stock prices.
	Complexity:
		Time: O(n^2)
		Space: O(1)
	"""
	if len(stock_prices) < 2:
		raise ValueError('stock price list must be at least 2 items long')

	highest_profit = None
	for i, stock_price_purchased in enumerate(stock_prices):
		for stock_price_sold in stock_prices[i + 1:]:
			profit = stock_price_sold - stock_price_purchased
			if not highest_profit or profit > highest_profit:
				highest_profit = profit

	return highest_profit