(int[] orientation, int index, int length, boolean zeroSum)
| 172 | } |
| 173 | |
| 174 | public static void idxToOri(int[] orientation, int index, int length, boolean zeroSum) { |
| 175 | int sum = 0; |
| 176 | int start = zeroSum ? length - 2 : length - 1; |
| 177 | for (int i = start; i >= 0; i--) { |
| 178 | orientation[i] = index % 3; |
| 179 | index /= 3; |
| 180 | sum += orientation[i]; |
| 181 | } |
| 182 | if (zeroSum) |
| 183 | orientation[length - 1] = 3 - sum % 3; |
| 184 | } |
| 185 | |
| 186 | // combinations |
| 187 | public static int combToIdx(int[] comb, int k, int n) { |
no outgoing calls
no test coverage detected