You are viewing a single comment's thread. Return to all comments →
THIS IS MY PYTHON CODE:
#!/bin/python3 import math import os import random import re import sys # # Complete the 'countApplesAndOranges' function below. # # The function accepts following parameters: # 1. INTEGER s # 2. INTEGER t # 3. INTEGER a # 4. INTEGER b # 5. INTEGER_ARRAY apples # 6. INTEGER_ARRAY oranges # def countApplesAndOranges(s, t, a, b, apples, oranges): apple_count = 0 orange_count = 0 for d in apples: if s <= a + d <= t: apple_count += 1 for d in oranges: if s <= b + d <= t: orange_count += 1 print(apple_count) print(orange_count) if __name__ == '__main__': first_multiple_input = input().rstrip().split() s = int(first_multiple_input[0]) t = int(first_multiple_input[1]) second_multiple_input = input().rstrip().split() a = int(second_multiple_input[0]) b = int(second_multiple_input[1]) third_multiple_input = input().rstrip().split() m = int(third_multiple_input[0]) n = int(third_multiple_input[1]) apples = list(map(int, input().rstrip().split())) oranges = list(map(int, input().rstrip().split())) countApplesAndOranges(s, t, a, b, apples, oranges)
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 →
THIS IS MY PYTHON CODE: