human
Minimum cost required to rearrange a given array to make it equal to another given array | Function to find lower_bound.
Function to find length of the longest common subsequence.
Find position where element is to be inserted.
Return the length of LCS.
Function to find the minimum cost required to convert the sequence A exactly same as B.
Auxiliary array.
Stores positions of elements of A [ ] Initialize index array with - 1.
Update the index array with index of corresponding elements of B.
Place only A 's array values  with its mapped values  into nums array.
Find LCS.
No of elements to be added in array A [ ].
Stores minimum cost.
Print the minimum cost.
Given array A [ ].
Given C.
Size of arr A.
Size of arr B.
Function call"
Solution in Python:

=====
Can you provide a code to minimum cost required to rearrange a given array to make it equal to another given array and the other steps required?
assistant
#Here is code to minimum cost required to rearrange a given array to make it equal to another given array and the other steps required.
 def LowerBound ( a , k , x ) :
	l = - 1
	r = k
	while ( l + 1 < r ) :
		m = ( l + r ) >> 1
		if ( a [ m ] >= x ) :
			r = m
		else :
			l = m
	return r
def findLCS ( nums , N ) :
	k = 0
	for i in range ( N ) :
		pos = LowerBound ( nums , k , nums [ i ] )
		nums [ pos ] = nums [ i ]
		if ( k == pos ) :
			k = pos + 1
	return k
def minimumCost ( A , B , M , N , C ) :
	nums = [ 0 ] * 100000
	index = [ - 1 ] * 100000
	for i in range ( N ) :
		index [ B [ i ] ] = i
	k = 0
	for i in range ( M ) :
		if ( index [ A [ i ] ] != - 1 ) :
			k += 1
			nums [ k ] = index [ A [ i ] ]
	lcs_length = findLCS ( nums , k )
	elements_to_be_added = N - lcs_length
	min_cost = elements_to_be_added * C
	print ( min_cost )
A = [ 1 , 6 , 3 , 5 , 10 ]
B = [ 3 , 1 , 5 ]
C = 2
M = len ( A )
N = len ( B )
minimumCost ( A , B , M , N , C )