如何制作一个每天接受公司股价信息的数组参数的函数? the day of buying < selling day在哪里。如果您没有获利,则会显示消息"You can't get profits these days"。例:输入:
the day of buying < selling day
"You can't get profits these days"
profit([10,2,11,20,3,5])
输出:
18
和输入:
profit([33,29,11,3])
“这些天你无法获得利润”
请帮助我理解此算法