Tap here to switch tabs
Problem
Submissions

Problem: Redistribute Characters to Make All Strings Equal

Redistribute Characters to Make All Strings Equal asks whether an array of strings can become identical by moving characters between distinct strings as many times as needed.

Statement

You are given an array of strings words.

In one operation, you can choose two distinct indices i and j, remove any character from words[i], and insert it at any position in words[j].

Return true if it is possible to make every string in words equal after applying any number of operations, or false otherwise.

Constraints:

  • 1≤1 \leq words.length ≤100\leq 100

  • 1≤1 \leq words[i].length ≤100\leq 100

  • words[i] consists of lowercase English letters.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Redistribute Characters to Make All Strings Equal

Redistribute Characters to Make All Strings Equal asks whether an array of strings can become identical by moving characters between distinct strings as many times as needed.

Statement

You are given an array of strings words.

In one operation, you can choose two distinct indices i and j, remove any character from words[i], and insert it at any position in words[j].

Return true if it is possible to make every string in words equal after applying any number of operations, or false otherwise.

Constraints:

  • 1≤1 \leq words.length ≤100\leq 100

  • 1≤1 \leq words[i].length ≤100\leq 100

  • words[i] consists of lowercase English letters.