• + 1 comment

    i do not think this should work.say you find a case where the prices happen to only increase, then ths would mean that there would not be a solution since the result must be a loss, but your algorithm would still find the solution due to its use of sorting. i am also not sure if i am making sense