I have a range of numbers in each cell that range from 0 through 9

Example:

A1=2

A2=4

A3=3

A4=5

A5=3

A6=5

A7=1

A8=6

A9=3

A10=4

I am looking to take the values in cell range A1:A10 and place the values in order as follows:

Values that appear the most to least.

So in the example above the result would be:

3334455216

The above calculations will be in cell range B1:B10

Next I want to take the 3334455216 and remove the duplicates.

So the result would be 345216

This would go in cell range C1:C6.

Example 1: Above

2435351634 (Cell range A1:A10) User entered values

3334455216 (Cell range B1:B10) Arrange in order-duplicate values that appear the highest 1st

345216 (Cell range C1:C6) Remove Duplicates from B1:B10

Example 2:

254925582 (Cell range A1:A9) User entered values

222555498 (Cell range B1:B9) Arrange in order-duplicate values that appear the highest 1st

25498 (Cell range C1:C5) Remove duplicates from B1:B9

Example 3:

4165323 (Cell range A1:A7) User entered values

3341652 (Cell range B1:B7) Arrange in order-duplicate values that appear the highest 1st

341652 (Cell range C1:C6) Remove duplicate from B1:B7

Thank you in advance!!