Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for [old] Create Intervals by mozurin
"use strict";
function createIntervals(data)
{
return data.sort((a, b) => a - b).reduce(
(s, e) => {
if (!s.length || s[0][1] + 1 != e) {
s.unshift([e, e]);
} else {
s[0][1]++;
}
return s;
},
[]
).reverse();
}
June 18, 2018