rearrange-array-to-maximize-prefix-score- TS Solution
\n\n# Code\ntypescript []\nfunction maxScore(nums: number[]): number {\n    nums = nums.sort((a, b) => b - a);\n    let sum = 0;\n    let positiveInts = 0;\n\n 
\n\n# Code\n```typescript []\nfunction maxScore(nums: number[]): number {\n    nums = nums.sort((a, b) => b - a);\n    let sum = 0;\n    let positiveInts = 0;\n\n    for(let i = 0; i < nums.length; i++){\n        sum += nums[i];\n        if(sum > 0) positiveInts++;\n    }\n    return positiveInts;\n    \n};\n```
['Array', 'Greedy', 'Sorting', 'Prefix Sum', 'TypeScript']