Permuting Two Arrays

  • + 0 comments

    My Python solution

    def twoArrays(k, A, B):
        # Write your code here    
        A.sort()
        B.sort(reverse=True)    
        for a,b in zip(A,B):
            if a+b <k:
                return "NO"
        
        return "YES"