code: function setBit(arr, n, val) {
                  var index = n >> 5; // Same as Math.floor(n/32)
                  var mask = 1 << (31 - n % 32);
                  if (val)
                      arr[index] = mask | arr[index];
                  else
                      arr[index] = ~mask & arr[index];
                  return arr;
              }
docs: Sets the n value of array arr to the value val
  @param {Array} arr
  @param {number} n
  @param {boolean} val
  @return {Array}