Created
April 8, 2020 08:23
-
-
Save magicly/c69b82db9837a65faccb2b3a6285c1e9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const bushu = (n, arr) => { | |
if (n < 10) return; | |
if (n > 10000000) return; | |
let newArr = []; | |
for (let i = 1; i <= n; i++) { | |
if (arr.indexOf(i) == -1) { | |
newArr.push(i); | |
} | |
} | |
return newArr; | |
}; | |
console.log(bushu(100, [1, 2, 3, 4, 7, 9, 10, 100])); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment