문제 링크 : Missing Number
/** * @param {number[]} nums * @return {number} */ var missingNumber = function(nums) { const nArr = new Array(nums.length+1).fill(0); nums.forEach(e => { nArr[e] += 1 }) return nArr.indexOf(0) };