Python how to find and group similar permutations of 4 digits : I am not good at these, but please bear with me.
I have a set of numbers from my database / list, all is 4 digit numbers with the numbers between and include 0000 through 9999.

Say the `list = [1234, 4354, 6554, 2134, 3214, 5456, 9911, 1199]`
Basically i want to group them in such a way:

    1234, 2134, 3214 is group A
    6554, 5456 is group B
    9911, 1199 is group C
    4354 is group D

Then i will find the len(group A), len(group B), len(group C), len(group D)...
and then sort them in decreasing manner.

How to do it?
And if list is huge, is the method still works ok?


