#力扣 LeetCode1588. 所有奇数长度子数组的和 @FDDLC
发布日期:2021-06-30 21:04:56 浏览次数:2 分类:技术文章

本文共 459 字,大约阅读时间需要 1 分钟。

题目描述:

 

Java代码:

class Solution {    public int sumOddLengthSubarrays(int[] a) {//len>=1        int ans=0;        for(int len=1;len<=a.length;len+=2){            for(int bg=0,ed=a.length-len;bg<=ed;bg++){                for(int i=0;i

 

Java代码二:

class Solution {    public int sumOddLengthSubarrays(int[] a) {//len>=1        for(int i=1;i

 

Java代码三:

class Solution {    public int sumOddLengthSubarrays(int[] a) {        int ans=0;        for(int i=0,l=1,r=a.length;i

转载地址:https://liuxingchang.blog.csdn.net/article/details/116374060 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:#力扣 LeetCode1464. 数组中两元素的最大乘积 @FDDLC
下一篇:#力扣 LeetCode1403. 非递增顺序的最小子序列 @FDDLC

发表评论

最新留言

关注你微信了!
[***.104.42.241]2024年04月20日 08时57分26秒