function solution(x){
let count = 0;
for(let i = 0 ; i < x.length;i++){
if(x[i] > x[i + 1]){
x[i + 1] = x[i] + 1
count++
console.log(x)
}
if(x[i] < x[i + 1]){
x[i + 1] = x[i] + 1
count++
}
console.log(x)
if(x[i] >= x[i + 1]){
x[i + 1] = x[i] + 1
count++
}
console.log(count)
}
}
console.log(solution([2,3,3,5,5,5,4,12,12,10,15]))
function solution(arr){
return arr.sort( (a, b) => a <b )
}
console.log(solution([2,3,3,5,5,5,4,12,12,10,15]))