function encodeSignedIntegers(numbers) {
  for (let i = 0, ii = numbers.length; i < ii; ++i) {
    const num = numbers[i];
    numbers[i] = num < 0 ? ~(num << 1) : num << 1;
  }
  return encodeUnsignedIntegers(numbers);
}
Encode a list of signed integers and return an encoded string

Attention: This function will modify the passed array!

@param {Array<number>} numbers A list of signed integers.
@return {string} The encoded string.