zigzagToInt method

int zigzagToInt(
  1. int n
)

Implementation

int zigzagToInt(int n) {
  return (n >> 1) ^ -(n & 1);
}