// 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"].

@@ -145,8 +145,497 @@
 %22,%227%22%5D.%0A
+%0A%0Avar summaryRanges = function(nums)%7B%0A    var result = %5B%5D,%0A        start = nums%5B0%5D,%0A        lower,%0A        i;%0A%0A    for( i=1; i%3C=nums.length; i++ )%7B%0A       // 0, 1, 2, 5, 7%0A       lower = nums%5Bi-1%5D; // 2%0A%0A       if( lower+1 !== nums%5Bi%5D )%7B // 2+1 !== 5%0A            result.push( getRange(start, lower) ); // 0 -%3E 2%0A            start = nums%5Bi%5D; // 5%0A        %7D%0A    %7D%0A    return result;%0A%7D;%0Afunction getRange( start, end )%7B%0A    return start === end ? start.toString() : %5Bstart,end%5D.join('-%3E');%0A%7D%0A

add solution