leetcode.com/problems/rotate-function 瞪眼看一下,很快就能發現規律了: F(k) = F(k-1) + \text{sum}(\text{nums}) - n \cdot \text{nums}[n-k] from typing import List class Solution: def maxRotateFunction(self, nums: List…
leetcode.com/problems/rotate-function 瞪眼看一下,很快就能發現規律了: F(k) = F(k-1) + \text{sum}(\text{nums}) - n \cdot \text{nums}[n-k] from typing import List class Solution: def maxRotateFunction(self, nums: List…
讨论
登录后参与讨论
还没有评论,来说第一句吧。