We define the conversion array conver of an integer array nums such that conver[i] = nums[i] + max(nums[0...i]), where max(nums[0...i]) is the maximum value among the elements of nums from index i.
The score of a prefix of nums ending at index i is the sum of all values in conver from index i.
Given an integer array nums, return an array ans of the same length where ans[i] represents the score of the prefix of nums ending at index i.
Constraints:
nums.length
nums[i]
We define the conversion array conver of an integer array nums such that conver[i] = nums[i] + max(nums[0...i]), where max(nums[0...i]) is the maximum value among the elements of nums from index i.
The score of a prefix of nums ending at index i is the sum of all values in conver from index i.
Given an integer array nums, return an array ans of the same length where ans[i] represents the score of the prefix of nums ending at index i.
Constraints:
nums.length
nums[i]