class Solution:
def maxProfit(self , prices ):
# write code here
maxProfit = 0
n = len(prices)
for i in range(n-1):
for j in range(i+1,n):
profit = (prices[j]-prices[i])
if maxProfit < profit:
maxProfit = profit
return maxProfit