Problem Statement | |||||||||||||
| An undirected graph is defined as a set of vertices with undirected edges connecting some of the pairs of vertices. A clique in an undirected graph is a non-empty subset of vertices where there is a direct connection between every pair of vertices in the subset. A maximal clique is a clique that is not a proper subset of any other clique. You will be given a graph as a String[] where the jth character of the ith element is a '1' if and only if vertices i and j are connected. Your method should return the number of maximal cliques in the graph. | |||||||||||||
Definition | |||||||||||||
| |||||||||||||
Constraints | |||||||||||||
| - | graph will contain between 1 and 20 elements, inclusive. | ||||||||||||
| - | Each element of graph will contain as many characters as graph has elements. | ||||||||||||
| - | Each character in graph will be '0' or '1'. | ||||||||||||
| - | Character j of element i of graph will be the same as character i of element j for all i and j. | ||||||||||||
| - | Character i of element i of graph will be '0' for all i. | ||||||||||||
Examples | |||||||||||||
| 0) | |||||||||||||
| |||||||||||||
| 1) | |||||||||||||
| |||||||||||||
| 2) | |||||||||||||
| |||||||||||||
| 3) | |||||||||||||
| |||||||||||||