Problem Statement | |||||||||||||
You are given several colored bricks. Every face of each brick has some color. Only seven colors are used. Two bricks are equal if they have the same colors on corresponding faces, permitting arbitrary rotations in space. Return the minimum number of faces that must be repainted for all the bricks to be equal. You are given a String[] bricks, each element of which represents a single brick. Each brick is represented as a 6 character string containing the colors of the 6 faces in the following order: front, right, back, left, top and bottom. The digits '0' through '6' are used to denote the seven colors. | |||||||||||||
Definition | |||||||||||||
| |||||||||||||
Constraints | |||||||||||||
- | bricks will contain between 1 and 50 elements, inclusive. | ||||||||||||
- | Each element of bricks will contain exactly six characters. | ||||||||||||
- | Each element of bricks will contain only the digits '0'-'6'. | ||||||||||||
Examples | |||||||||||||
0) | |||||||||||||
| |||||||||||||
1) | |||||||||||||
| |||||||||||||
2) | |||||||||||||
| |||||||||||||
3) | |||||||||||||
| |||||||||||||
4) | |||||||||||||
|