You are participating in a famous TV Quiz. In the final stage of this quiz you must guess the correct answer for a question posed by the quizmaster. The quizmaster tells you the length of the answer. The quiz consists of one or more turns. On each turn, you may either answer the question or ask for a hint. You must be sure of the solution before answering the question. When asking for a hint, you tell a letter to the quizmaster, and he reveals all occurrences of this letter to you. Unfortunately, your prize decreases with each hint, so you want to win the game with as few hints as possible.
You are given a list of all possible answers in the String[] words. Return the minimal number of hints needed to determine the correct answer.
|