Problem Statement | |||||||||||||
| You are a carpenter and you want to build several pieces of furniture. Unfortunately, you've lost all your tools. You are given a String[] need, the i-th element of which is a space separated list of the tools required to construct the i-th piece of furniture. Return the number of different tools you must buy to construct all the furniture. | |||||||||||||
Definition | |||||||||||||
| |||||||||||||
Constraints | |||||||||||||
| - | need will contain between 1 and 50 elements, inclusive. | ||||||||||||
| - | Each element of need will contain between 1 and 50 characters, inclusive. | ||||||||||||
| - | Each element of need will contain only uppercase letters ('A'-'Z') and spaces (' '). | ||||||||||||
| - | Each element of need will contain no leading, trailing, or consecutive spaces. | ||||||||||||
| - | For each element of need, all tool names in it will be distinct. | ||||||||||||
Examples | |||||||||||||
| 0) | |||||||||||||
| |||||||||||||
| 1) | |||||||||||||
| |||||||||||||
| 2) | |||||||||||||
| |||||||||||||