A list of numbers are given. We need to find the total number of groups in which the digits of each number have same frequency.

For example if numbers are:

1

10

303

330

There are 3 groups:

G1={1}has one 1.

G2={10} has one 1 and one 0.

G3={330, 303} has one 0 and two 3s.