摘要:
1005.K次取反后最大化的数组和 class Solution: def largestSumAfterKNegations(self, nums: List[int], k: int) -> int: nums.sort(key=lambda x:abs(x), reverse=True) fo 阅读全文
posted @ 2023-11-13 17:37
忆象峰飞
阅读(9)
评论(0)
推荐(0)
摘要:
122.买卖股票的最佳时机 II 1、贪心 class Solution: def maxProfit(self, prices: List[int]) -> int: res = 0 for i in range(1, len(prices)): res += max(prices[i]-pric 阅读全文
posted @ 2023-11-13 16:03
忆象峰飞
阅读(9)
评论(0)
推荐(0)