function increaseArray(arr) { const set1 = new Set(); let count = 0; for (let i = 0; i < arr.length; i++) { let w = arr[i]; while (set1.has(w)) { w++; count++; } set1.add(w); } return count } 大佬麻烦看看第二题这样解的问题
点赞 1

相关推荐

牛客网
牛客网在线编程
牛客网题解
牛客企业服务