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
|
3095 Discussions
|
Please Login in order to post a comment
Here i use c++ 20, what do you think guys?
void countApplesAndOranges(int s, int t, int a, int b, vector apples, vector oranges) { int sumApple = 0; int sumOrange = 0;
}
func countApplesAndOranges(s: Int, t: Int, a: Int, b: Int, apples: [Int], oranges: [Int]) -> Void { let appleNewPos = apples.map { val in return val+a }.filter { val in val>=s && val<=t } let orangeNewPos = oranges.map { val in return val+b }.filter { val in val>=s && val<=t } print("(appleNewPos.count)") print("(orangeNewPos.count)") }