技术栈

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 自定义样式 - 渲染矢量数据
相关推荐
CoderYanger
18 分钟前
A.每日一题——2536. 子矩阵元素加 1
java·线性代数·算法·leetcode·矩阵
倦王
2 小时前
力扣日刷251117
算法·leetcode·职场和发展
Swift社区
7 小时前
LeetCode 427 - 建立四叉树
算法·leetcode·职场和发展
墨染点香
8 小时前
LeetCode 刷题【160. 相交链表】
算法·leetcode·链表
少睡点觉
8 小时前
LeetCode 238. 除自身以外数组的乘积 问题分析+解析
java·算法·leetcode
YoungHong1992
8 小时前
面试经典150题[066]:分隔链表(LeetCode 86)
leetcode·链表·面试
Wenhao.
11 小时前
LeetCode 救生艇
算法·leetcode·golang
夏鹏今天学习了吗
11 小时前
【LeetCode热题100(69/100)】字符串解码
linux·算法·leetcode
小白程序员成长日记
11 小时前
2025.11.18 力扣每日一题
算法·leetcode·职场和发展
未若君雅裁
13 小时前
LeetCode 18 - 四数之和 详解笔记
java·数据结构·笔记·算法·leetcode
热门推荐
01GitHub 镜像站点02今天 Cloudflare 全球事故,连 GPT 和你的网站都一起“掉线”了03UV安装并设置国内源04安娜的档案(Anna’s Archive) 镜像网站/国内最新可访问入口(持续更新)05Linux下V2Ray安装配置指南06BongoCat - 跨平台键盘猫动画工具07全球最强模型Grok4,国内已可免费使用!(附教程)08Valdi:Snapchat 开源的新一代跨平台 UI 框架09swagger xss漏洞复现10Labelme从安装到标注:零基础完整指南