You are viewing a single comment's thread. Return to all comments →
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)") }
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 →
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)") }