(int[] flip, int index, int length, boolean zeroSum)
| 153 | } |
| 154 | |
| 155 | public static void idxToFlip(int[] flip, int index, int length, boolean zeroSum) { |
| 156 | int sum = 0; |
| 157 | if (zeroSum) length--; |
| 158 | for (int i = length - 1; i >= 0; i--) { |
| 159 | sum ^= flip[i] = index & 1; |
| 160 | index >>= 1; |
| 161 | } |
| 162 | if (zeroSum) flip[length] = sum; |
| 163 | } |
| 164 | |
| 165 | // orientation |
| 166 | public static int oriToIdx(int[] orientation, int length, boolean zeroSum) { |
no outgoing calls
no test coverage detected