code: function toHash(highRank, arr) {
    const hash = {}
    for (let i = 0; i < arr.length; i++) {
      hash[highRank + arr[i]] = i
    }
    hash._size = arr.length
    return hash
  }
docs: None of the code here is elegant as I prefered to spell things out by hand instead of having to overheat my brain. If you find a more elegant solution, granted I can still follow it and it's not overly elegant, please submit a PR :)