You can give weight-age to each character , like if you say A = 1, B = 2, C = 3
and then you want to check that is ABC and BCA or CAB are the same or not
simple add their weight-age, if the resultant sum is same on both side, then they have same Character, else they don’t have same character
ABC = 1+2+3 = 6
BAC = 2+1+3 = 6
CAB = 3+1+2 = 6,
all of them are having the same output, just because of the Weight-age.