Maximum Gap
Hard
Array Techniques
Print the maximum difference between two successive elements of the array in sorted order (0 if fewer than two elements). The solution should run in linear time.
Constraints
1 <= n <= 10^5 0 <= nums[i] <= 10^9
Discussion
No discussions yet.
Join Shalyam Newsletter
Get exclusive insights with every issue: education, research and innovation news.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.