code: private long primeProduct(int[] ws, long[] ranks, boolean[] hydrogens) {
          long prod = 1;
          for (int w : ws) {
              if (!hydrogens[w]) {
                  prod *= PRIMES[(int) ranks[w]];
              }
          }
          return prod;
      }
docs: Compute the prime product of the values (ranks) for the given
  adjacent neighbors (ws).
  
  @param ws    indices (adjacent neighbors)
  @param ranks invariant ranks
  @return the prime product