If string A and string B contain the same characters, they are called “brother string”.
for example: “abc” and “cab”, “aabb” and “baab”.
The question is how to check if two strings are brother string(fast)?
If string A and string B contain the same characters, they are called brother
Share
Sort them then compare, or keep a count of each character in a map of some sort then compare counts at the end.