A = ['d','a','c','a','a','d','a','d','c','e']
B = ['a','d','c','e']
C = ['z','x', 'y','k']
As you can see from above, I have three lists. List A is a random mix of characters, and B is a reordering of elements in the A list by frequency without duplicating them. The list C is the values I want to replace. I would like to check if the values in list B are in A and change the values in list A to those in list C. If there is a value 'B[0]' in list A, I would like to change all 'B[0]' values in list A change to C[0]. The rest of the elements also want to do so.
What I want:
A=['x','z','y','z','z','x','z','x','y','k']