3452. 好数字之和

题目来源:

        LeetCode题目:3452. 好数字之和 - 力扣(LeetCode)

解题思路:

        按要求判断求和即可。

解题代码:

#python3
class Solution:
    def sumOfGoodNumbers(self, nums: List[int], k: int) -> int:
        res=0
        length=len(nums)
        for i in range(length):
            if (i-k>=0 and nums[i]<=nums[i-k]) or (i+k
 
  

总结:

        无官方题解。


你可能感兴趣的:(LeetCode,刷题,LeetCode)