Skip to content

Instantly share code, notes, and snippets.

@erhanyasar
Last active March 9, 2023 14:11
Show Gist options
  • Save erhanyasar/3c4ace73d91f0ba6d6dbb9bdc5f7fc83 to your computer and use it in GitHub Desktop.
Save erhanyasar/3c4ace73d91f0ba6d6dbb9bdc5f7fc83 to your computer and use it in GitHub Desktop.
Some Quiz Questions Solved
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);
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