docs: function lowestUnused(xs) {
      let unused = 0;
      for (let i = 0; i < xs.length; i++) {
          if (xs[i] === unused) {
              unused++;
              i = -1; // go back to the beginning
          }
      }
      return unused;
  }