Problem Statement | |||||||||||||
You are analyzing a communications network with at most 18 nodes. Character j in element i (both 0-based) of mat denotes whether nodes i and j can communicate ('Y' for yes, 'N' for no). Assuming a node cannot communicate with two nodes at once, return the maximum number of nodes that can communicate simultaneously. | |||||||||||||
Definition | |||||||||||||
| |||||||||||||
Notes | |||||||||||||
- | If node S is communicating with node T then node T is communicating with node S. | ||||||||||||
Constraints | |||||||||||||
- | mat will contain between 1 and 18 elements inclusive. | ||||||||||||
- | Each element of mat will contain exactly N characters, where N is the number of elements in mat. | ||||||||||||
- | Each character in mat will be 'Y' or 'N'. | ||||||||||||
- | Character i of element i of mat will be 'N'. | ||||||||||||
- | Character i of element j will be the same as character j of element i. | ||||||||||||
Examples | |||||||||||||
0) | |||||||||||||
| |||||||||||||
1) | |||||||||||||
| |||||||||||||
2) | |||||||||||||
| |||||||||||||
3) | |||||||||||||
|