ClawMart:OpenClaw技能治理协议与软件供应链实践
2026/6/24 20:06:24
题目地址:链接
思路:遍历时记录最小值,当前值减去历史最小值
functionmaxProfit(prices:number[]):number{letans=0letlastMin=prices[0]for(constpriceofprices){lastMin=Math.min(lastMin,price)ans=Math.max(ans,price-lastMin)}returnans};