Problem Statement | |||||||||||||
NOTE: This problem statement contains images that may not display properly if viewed outside of the applet.
Rabbit Taro wants to color the vertices of a cube. He thinks the cube will be beautiful if:
There are N types of colors. You are given a String[] colors. The j-th color is suitable for the i-th vertex if the j-th character of the i-th element of colors is 'Y'. Return the number of different ways to color the cube. | |||||||||||||
Definition | |||||||||||||
| |||||||||||||
Notes | |||||||||||||
- | Two ways are different if there exists an i such that the i-th vertex has a different color in one way than it does in the other way. | ||||||||||||
Constraints | |||||||||||||
- | colors will contain exactly 8 elements. | ||||||||||||
- | Each element in colors will contain between 1 and 32 characters, inclusive. | ||||||||||||
- | Each element in colors will contain the same number of characters. | ||||||||||||
- | Each character in colors will be 'Y' or 'N'. | ||||||||||||
Examples | |||||||||||||
0) | |||||||||||||
| |||||||||||||
1) | |||||||||||||
| |||||||||||||
2) | |||||||||||||
| |||||||||||||
3) | |||||||||||||
| |||||||||||||
4) | |||||||||||||
|