Rearrange array A[] in non-decreasing order by Swapping A[i] and C[j] if and only if B[i] equals to D[j]
Given arrays A[], B[], C[] and D[] of length N. The task is to output YES/NO by checking if A[] can be rearranged in non-decreasing order using below operation any number of times: Swap Ai and Cj if and only if Bi == Dj Examples: Input: N = 2, A[] = {3, 2}, B[] = {1, 2}, C[] = {1, 2}. D[] = {1, 1}Ou