code: function getWeight(labels, labelWeight) {
    const places = labels.map(label => labelWeight.indexOf(label.name));
    let binary = '';
    for (let i = 0; i < labelWeight.length; i++) {
      binary += places.includes(i) ? '1' : '0';
    }
    return parseInt(binary, 2);
  }
docs: Calculates the weight of a given array of labels