Is there a way to check if two strings contain the same characters. For example,
abc, bca -> true
aaa, aaa -> true
aab, bba -> false
abc, def ->
Consider creating a signature for a given String. Using count and character.
a-count:b-count:c-count:.....:z-count: (extend for upper case if you want ).
Then compare the signature. This should scale better for very large Strings.
As a shortcut, check the length. If they are not matching, return false anyway.