Last active
March 9, 2023 14:11
-
-
Save erhanyasar/3c4ace73d91f0ba6d6dbb9bdc5f7fc83 to your computer and use it in GitHub Desktop.
Some Quiz Questions Solved
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
let A = [4,12,9,5,6,1], | |
B = [4,9,12,6]; | |
function findMissing(A, B){ | |
let missingElements = []; | |
for (var i=0; i<A.length; i++){ | |
for (var j=0; j<B.length; j++){ | |
if (A[i] == B[j]) | |
break; | |
else { | |
if (j == (B.length-1)){ | |
missingElements.push(A[i]); | |
} | |
} | |
} | |
continue; | |
} | |
console.log(missingElements); | |
return missingElements; | |
} | |
findMissing(A, B); |
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
function fizzBuzz(n) { | |
for (let i=1; i<n+1; i++){ | |
if (i % 15 == 0) | |
console.log("FizzBuzz"); | |
else if (i % 5 == 0) | |
console.log("Buzz"); | |
else if (i % 3 == 0) | |
console.log("Fizz"); | |
else | |
console.log(i); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment