Permuting Two Arrays

  • + 0 comments
    def twoArrays(k, A, B):
        A =  sorted(A, reverse=True)
        B =  sorted(B)
        
        for i, num in enumerate(A):
            if A[i] + B[i] < k:
                return 'NO'
        
        return 'YES'