coding write an algorithm to help the compony know the number of profitable days in the lisrlt
Answers
Answered by
2
Answer:
- A person is eligible to cast his /her vote or not is evaluated by person's age if it is greater than or equal to 18(age >= 18) then .
Answered by
0
Answer: Python Program
Concept : Maximum Profit Algorithm
Explanation:
# Python program
def maximumProfit(A):
m = 0
for i in range(0, len(A)-1):
buy, sell = A[i], max(A[i+1:])
m = max(m, sell-buy)
return m
n = int(input())
prices = []
for i in range(n):
prices.append(int(input()))
print(maximumProfit(prices))
#SPJ3
Similar questions