Search
⌘K

Leetcode 228. Summary Ranges

Given a sorted, unique integer array, compress consecutive runs of numbers into the minimal list of inclusive ranges that exactly cover all elements. Output each range as "a->b" if it spans multiple numbers or "a" if it’s a single number.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.