Permuting Two Arrays

  • + 0 comments
    def twoArrays(k, A, B):
        A.sort()
        B.sort(reverse=True)
        for i in range(len(A)):
            if A[i] + B[i] < k:
                return "NO"
        return "YES"