function solution(statues) {
var min = Math.min(...statues);
var max = Math.max(...statues);
var count = 0;
for (var i = min; i <= max; i++) {
if (!statues.includes(i)) {
count++;
}
}
return count;
}