Skip to content

Practice Maximize Score of Numbers in Ranges

Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.

Medium#3281
LeetCode Problem

Maximize Score of Numbers in Ranges

Problem Statement

You are given an array of integers start and an integer d, representing n intervals [start[i], start[i] + d]. You are asked to choose n integers where the ith integer must belong to the ith interval. The score of the chosen integers is defined as the minimum absolute difference between any two integers that have been chosen. Return the maximum possible score of the chosen integers.

Source: Maximize Score of Numbers in Ranges on LeetCode. Use the original task for its coding environment and submissions.

Examples

# Example 1

Input
start = [6,0,3], d = 2
Output
4

# Example 2

Input
start = [2,6,13,13], d = 5
Output
5

Constraints

2 <= start.length <= 10^5
0 <= start[i] <= 10^9
0 <= d <= 10^9

Related LeetCode Problems

Practice more problems similar to Maximize Score of Numbers in Ranges.

Review your practice with PhantomCodeAI

After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.