Ayush7614 / Ayush7614/Daily-Coding-DS-ALGO-Practice

Leetcode Hard Maximum Gap

Open
#975 5 comments 0 reactions 1 assignee Claimed by @sardonicankita View on GitHub
LGMSOC21 🟧 Level3
Dominant language
C++
Stars
323
Forks
472
PR merge metrics
No merged PRs in 30d

Description

# Aim

To solve the Leetcode Hard problem _"Maximum Gap"_ in C++.
Admins please assign this to me under LGM SOC'21.

# Details

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

**Example**
**Input**: nums = [3,6,9,1]
**Output:** 3
Explanation: The sorted form of the array is [1,3,6,9], either (3,6) or (6,9) has the maximum difference 3.

### Programming language

- [ ] C
- [x] C++
- [ ] Java
- [ ] Python

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.