We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
let applesInHome = 0;
let orangesInHome = 0;
let i = 0;
while (i < apples.length || i < oranges.length) {
if (i < apples.length && apples[i] + a >= s && apples[i] + a <= t) {
applesInHome++;
}
if (i < oranges.length && oranges[i] + b >= s && oranges[i] + b <= t) {
orangesInHome++;
}
i++;
}
console.log(applesInHome);
console.log(orangesInHome);
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Apple and Orange
You are viewing a single comment's thread. Return to all comments →
On `javascript solution {
let applesInHome = 0; let orangesInHome = 0; let i = 0;