You are viewing a single comment's thread. Return to all comments →
Swift
func twoArrays(k: Int, A: [Int], B: [Int]) -> String { let first = A.sorted() let second = B.sorted(by: >) for (a, b) in zip(first, second) { if a + b < k { return "NO" } } return "YES" }
Seems like cookies are disabled on this browser, please enable them to open this website
Permuting Two Arrays
You are viewing a single comment's thread. Return to all comments →
Swift