Tap here to switch tabs
Problem
Submissions

Problem: Maximum Gap

med
30 min
Try to solve the Maximum Gap problem.

Statement

Given an integer array nums, return the maximum difference between two successive elements in its sorted form. If the array contains fewer than 22 elements, return 00.

Note: Successive elements are adjacent elements in the sorted order of nums.

Constraints:

  • 1≤1 \leq nums.length ≤105\leq 10^5

  • 0≤0 \leq nums[i] ≤109\leq 10^9

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Maximum Gap

med
30 min
Try to solve the Maximum Gap problem.

Statement

Given an integer array nums, return the maximum difference between two successive elements in its sorted form. If the array contains fewer than 22 elements, return 00.

Note: Successive elements are adjacent elements in the sorted order of nums.

Constraints:

  • 1≤1 \leq nums.length ≤105\leq 10^5

  • 0≤0 \leq nums[i] ≤109\leq 10^9