技术栈

2640. Find the Score of All Prefixes of an Array

ujn201612222024-09-14 22:49

2640. Find the Score of All Prefixes of an Array

python 复制代码
class Solution:
    def findPrefixScore(self, nums: List[int]) -> List[int]:
        conver=[nums[0]*2]
        premax=nums[0]
        for i in range(1,len(nums)):
            premax=max(premax,nums[i])
            conver.append(conver[-1]+premax+nums[i])
        return conver
上一篇:springboot后端开发-常见注解及其用途
下一篇:【WebGIS实例】(16)GeoServer 自定义样式 - 渲染矢量数据
相关推荐
Nuanyt
15 小时前
LeetCode Hot 100 链表专题(五)· 2 题(Java)
java·算法·leetcode·链表
圣保罗的大教堂
18 小时前
leetcode 3736. 最小操作次数使数组元素相等 III 简单
leetcode
文丑颜不良啊
19 小时前
LeetCode1881~1990题目解析
java·leetcode
文丑颜不良啊
1 天前
LeetCode1861~1880题目解析
java·leetcode
文丑颜不良啊
1 天前
LeetCode1921~1940题目解析
java·leetcode
一去不复返的通信er
1 天前
排序 + 双指针:力扣15三数之和
算法·leetcode
文丑颜不良啊
1 天前
LeetCode1901~1920题目解析
java·leetcode
Pniubi
1 天前
力扣3无重复字符的最长字串(滑动窗口)
算法·leetcode·职场和发展
文丑颜不良啊
3 天前
LeetCode1661~1680题目解析
java·leetcode
文丑颜不良啊
3 天前
LeetCode1721~1740题目解析
java·leetcode
热门推荐
01国内可直接用、免费额度/永久免费的大模型API清单(含 SiliconFlow、火山、阿里、智谱、百度、Kimi、DeepSeek、DMXAPI 等)02历年考研数学一、数学二、数学三真题试卷及答案PDF03如何新建文件夹? 电脑新建文件夹的4种方法04几个好用的ip纯净度检测网站05GitHub 镜像站点06昇腾910B系列芯片完全指南:四款型号对比、服务器选型与大模型部署实战07苹果iPA游戏软件资源下载网站08蜘蛛磁力 搜索引擎大全,如何使用蜘蛛磁力查找磁力链接09Dify:一站式AI应用开发平台全解析与Windows部署指南10Android 屏幕适配系列开篇:核心概念、官方机制与主流方案