Untitled
unknown
plain_text
a month ago
283 B
0
Indexable
fn(int[] arr) { prefixMax = 0; maxScore = 0; int score = 0; for(int j=0;j<n;j++) { score = prefixMax + arr[j] - j; maxScore = Math.max(maxScore,score); prefixMax = Math.max(prefixMax,arr[j] + j); } return maxScore; }
Editor is loading...
Leave a Comment