(int idx, int n)
| 250 | } |
| 251 | |
| 252 | static int getNParity(int idx, int n) { |
| 253 | int p = 0; |
| 254 | for (int i = n - 2; i >= 0; i--) { |
| 255 | p ^= idx % (n - i); |
| 256 | idx /= (n - i); |
| 257 | } |
| 258 | return p & 1; |
| 259 | } |
| 260 | |
| 261 | static void setNPerm(int[] arr, int idx, int n) { |
| 262 | arr[n - 1] = 0; |
no outgoing calls
no test coverage detected