This file contains hidden or 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 countApplesAndOranges(s, t, a, b, apples, oranges) { | |
// Write your code here | |
let applesOnHouse = 0; | |
let orangesOnHouse = 0; | |
const applesDistancesFromTree = apples.map((apple) => apple+a); | |
const orangesDistancesFromTree = oranges.map((orange) => orange+b); | |
applesDistancesFromTree.forEach((appleDistance) => { | |
if(appleDistance >= s && appleDistance <= t) applesOnHouse++; | |
}) | |
orangesDistancesFromTree.forEach((orangeDistance) => { |
This file contains hidden or 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 getTotalX(a, b) { | |
// Write your code here | |
let lowerBoundInt = a[a.length - 1]; | |
let upperBoundInt = b[0]; | |
let arrayInt = []; | |
let arrayForFactorsOfA = []; | |
let arrayWhoseFactorsAreB = []; | |
let finalArr = []; | |
if(lowerBoundInt > upperBoundInt) { |
OlderNewer