You are viewing a single comment's thread. Return to all comments →
Scala
def twoArrays(k: Int, A: Array[Int], B: Array[Int]): String = { val arraySize = A.length val sortedA = A.sorted val sortedB = B.sorted.reverse for(i <- (0 until arraySize).toArray) if(sortedA(i)+sortedB(i) < 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 →
Scala