Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. function countApplesAndOranges(s, t, a, b, apples, oranges) {
  2.  
  3. var appleCount = 0, orangeCount = 0;
  4. for (var prop1 in apples) {
  5. apples[prop1] = a + (apples[prop1]);
  6. if(apples[prop1] >= s && apples[prop1] <= t){
  7. appleCount++;
  8. }
  9. }
  10. for (var prop2 in oranges) {
  11. oranges[prop2] = b + (oranges[prop2]);
  12. if(oranges[prop2] >= s && oranges[prop2] <= t){
  13. orangeCount++;
  14. }
  15. }
  16. return [appleCount, orangeCount];
  17.  
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement