Missing Ranges

Easy
Arrays Array

Given sorted array and range [lo, hi], find missing ranges. Format: a->b or a.

Constraints

Fits in int

Examples

Example 1:
Input: 0 1 3 50 75 0 99
Output: 2 4->49 51->74 76->99
Example 2:
Input: 1 1
Output: 1
▲ Console
📱

Install Talent Enrich

Get instant access to jobs and career tools on your device.