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.
functioncountApplesAndOranges(s:number,t:number,a:number,b:number,apples:number[],oranges:number[]):void{// Write your code hereletappleCount=0letorangeCount=0for(letiofapples){if(a+i>=s&&a+i<=t)appleCount++;}for(letioforanges){if(b+i>=s&&b+i<=t)orangeCount++;}console.log(appleCount)console.log(orangeCount)}
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 →
Optimization code in TypeScript