• + 0 comments
    public static void countApplesAndOranges(int s, int t, int a, int b, List<int> apples, List<int> oranges)
        {
                int appleIncCount =0;
                int orangeIncCount =0;
                
                for(int i=0;i<apples.Count;i++){
                    if((apples[i] + a) >= s && (apples[i] + a) <= t ){
                        appleIncCount++;
                    }
                }
                
                 for(int i=0;i<oranges.Count;i++){
                    if((oranges[i] + b) >= s && (oranges[i] + b) <= t ){
                        orangeIncCount++;
                    }
                }
                Console.WriteLine(appleIncCount);
                Console.WriteLine(orangeIncCount);
        }