Most Unique Letters

Asked at Meta· Onsite

Reported by the problem's creator, not verified

Import another question

You are given a list of lowercase words. Pick a subset of the words so that no letter appears more than once across all picked words, counting repeats inside a single word too. A subset's value is the number of distinct letters it covers. Picking nothing is allowed and covers 0 letters.

Examples

  1. Example 1

    Input: words = ["un","iq","ue"]

    Output: 4

    Explanation: un and iq share no letter and cover u, n, i, q — 4 letters. ue shares u with un, so its best pairing is with iq, which also covers 4.

Import your own questions
Paste a question you were asked and get a full problem: statement, tests and a checked solution.
Import a question

Code

Loading editor…

Ln 1, Col 1

Start an attempt to use Coach.