human
Write me a code to check if two arrays can be made equal by reversing subarrays multiple times and the other steps required given the following:
Check if two arrays can be made equal by reversing subarrays multiple times | Function to check if array B can be made equal to array A.
Sort both the arrays.
Check if both the arrays are equal or not.
Driver Code"
Solution in Python:
assistant
#Here is code to check if two arrays can be made equal by reversing subarrays multiple times and the other steps required.
 def canMadeEqual ( A , B , n ) :
	A . sort ( )
	B . sort ( )
	for i in range ( n ) :
		if ( A [ i ] != B [ i ] ) :
		return False
	return True
if __name__ == " _ _ main _ _ " :
	A = [ 1 , 2 , 3 ]
	B = [ 1 , 3 , 2 ]
	n = len ( A )
	if ( canMadeEqual ( A , B , n ) ) :
		print ( " Yes " )
	else :
		print ( " No " )