deno.land / x / masx200_leetcode_test@10.6.5 / minimum-value-to-get-positive-step-by-step-sum / index.ts

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
function minStartValue(nums: number[]): number { let presum = 0; let ans = 1; for (const num of nums) { presum += num; ans = Math.max(ans, 1 - presum); } return ans;}export default minStartValue;
masx200_leetcode_test

Version Info

Tagged at
a year ago