If a word is exchanged for its alphabetic order, the obtained words are called sibling words. For example, Mary and army are sibling words. That is, the letters contained are the same, but the alphabetic order is different, when a user inputs a word, he/she needs to find all the brothers of the word in a dictionary and output the word. The corresponding data structure and algorithms are provided. Requires as low time and space complexity as possible
Current ideas:
Struct {
Char data;
Int n
};
According to the mathematical theorem, any natural number N greater than 1 can be uniquely divided into the product N = (P_1 ^ A1) of a finite prime number) * (P_2 ^ A2 )...... (P_n ^ An), here P_1 <P_2 <... <P_n is a prime number and is unique.
For example
A = 2 B = 3 c = 5 d = 7 E = 11...
F (ABCD) = 2*3*5*7 = 210
Then, the number of digits with the product of 210 in the dictionary must be the same as the five-letter combination.
Unknown Source