LeetCode-1588-所有奇数长度子数组的和

image.png
class Solution:
    def sumOddLengthSubarrays(self, arr: List[int]) -> int:
        ans = sum(arr)
        for i in range(0, len(arr)):
            for j in range(3, len(arr)+1, 2):
                if i+j

你可能感兴趣的:(LeetCode-1588-所有奇数长度子数组的和)