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