Determine whether the characters from all given strings can be redistributed so that every string becomes identical.
You are given an array of strings. You may take characters from any string and redistribute them among the strings in any way you want, as long as the total multiset of characters stays the same.
Your task is to determine whether it is possible to make every string in the array exactly the same after redistribution.
In other words, after rearranging and moving characters across strings, each string should end up with the same sequence of characters.
Return true if this is possible, otherwise return false.
words.a to z.Example 1
Input
words = ["abc","aabc","bc"]
Output
true
Explanation
Across all strings, the counts are: a=3, b=3, c=3. Since there are 3 strings, each character count is divisible by 3, so we can redistribute characters to make all strings equal to "abc".
Example 2
Input
words = ["ab","a"]
Output
false
Explanation
The total counts are a=2 and b=1. There are 2 strings, but b cannot be evenly distributed between them, so it is impossible to make both strings identical.
Premium problem context
Premium adds guided hints, editorial links, similar variants, discussion resources, and concept maps so you can understand why a problem matters, not just solve it once.