Tap here to switch tabs
Problem
Submissions

Problem: Maximize the Minimum Game Score

Try to solve the Maximize the Minimum Game Score problem.

Statement

You are given an integer array points of length nn and an integer m.

You start at index −1-1 with an array gameScore of size nn, where each element is initialized to 00.

In each move, you must change your current index by 11:

  • If your current index is −1-1, you must move to index 00.

  • If your current index is at least 00, you can either move to index i+1i + 1 (provided i+1<ni + 1 < n) or move to index i−1i - 1 (provided i−1≥0i - 1 \geq 0).

Each time you visit an index ii, the value gameScore[i] increases by points[i].

You are allowed to make at most m moves.

Return the maximum possible minimum value of gameScore across all its elements after at most m moves.

Constraints:

  • 2≤n==2 \leq n == points.length ≤5imes104\leq 5 imes 10^4

  • 1≤1 \leq points[i] ≤106\leq 10^6

  • 1≤1 \leq m ≤109\leq 10^9

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Maximize the Minimum Game Score

Try to solve the Maximize the Minimum Game Score problem.

Statement

You are given an integer array points of length nn and an integer m.

You start at index −1-1 with an array gameScore of size nn, where each element is initialized to 00.

In each move, you must change your current index by 11:

  • If your current index is −1-1, you must move to index 00.

  • If your current index is at least 00, you can either move to index i+1i + 1 (provided i+1<ni + 1 < n) or move to index i−1i - 1 (provided i−1≥0i - 1 \geq 0).

Each time you visit an index ii, the value gameScore[i] increases by points[i].

You are allowed to make at most m moves.

Return the maximum possible minimum value of gameScore across all its elements after at most m moves.

Constraints:

  • 2≤n==2 \leq n == points.length ≤5imes104\leq 5 imes 10^4

  • 1≤1 \leq points[i] ≤106\leq 10^6

  • 1≤1 \leq m ≤109\leq 10^9