private String makeRange(int a, int b) {
        if (a == b) {
            return String.valueOf(a);
        }
        return a + "->" + b;
    }
Date 10/19/2016
@author Tushar Roy

Given a sorted integer array without duplicates, return the summary of its ranges.
For example, given [0,1,2,4,5,7], return ["0->2","4->5","7"].

Solution -
Just check if num[i] + 1 != num[i + 1]. If its not equal means you need to add previous range to result
and start a new range.

Time complexity O(n)

https://leetcode.com/problems/summary-ranges/
src/com/interview/array/SummaryRanges.java