• + 0 comments

    This is java solution using stream api

    long app=apples.stream().filter(n->
            (a+n>=s && a+n<=t)
        ).count();
        long org=oranges.stream().filter(n->
            (b+n>=s && b+n<=t)
        ).count();
        
        System.out.println(app);
        System.out.println(org);