Permuting Two Arrays

  • + 0 comments

    simple very pythonic solution:

    def twoArrays(k, A, B):
        # Write your code here
        A.sort()
        B.sort(reverse=True)
        comprobations = [x + y >= k for x,y in zip(A, B)]
        return "YES" if all(comprobations) else "NO"