The maximum profit refers to the average profit or total profit?


  • 0
    B

    for example, for input [1, 3, 4, 10]
    if we buy at day one and sell at day four, the total profit is 9, but the average profit is 3;
    if we buy at day three and sell at day four, the total profit is 6, but the average profit is 6.
    which one to choose?


  • 2
    S

    The total profit.

    at least 30 characters
    at least 30 characters


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.