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.
Apple and Orange
Apple and Orange
Sort by
recency
|
2994 Discussions
|
Please Login in order to post a comment
php solution:
function countApplesAndOranges(t, b, oranges) { orange_count = 0;
}
Clean Python Code:
Optimization code in TypeScript
That is Brute force silution but not time env to examine all tests
public static void countApplesAndOranges(int s, int t, int a, int b, List apples, List oranges) { // Write your code here int nbrapples , nbroranges ; nbrapples = apples.stream().map( d -> a + d ) .filter(d ->( d >= s && d <= t)).collect(toList()).size(); nbroranges = oranges.stream().map( d -> b + d ) .filter(d ->( d >= s && d <= t)).collect(toList()).size();