code: @Override
      int[] contribution(IAtomContainer container, RingSearch ringSearch) {
  
          int n = container.getAtomCount();
          int[] electrons = new int[n];
          int[] piBonds = new int[n];
  
          // count number of cyclic pi bonds
          for (IBond bond : container.bonds()) {
              int u = container.indexOf(bond.getBegin());
              int v = container.indexOf(bond.getEnd());
  
              if (bond.getOrder() == DOUBLE && ringSearch.cyclic(u, v)) {
                  piBonds[u]++;
                  piBonds[v]++;
              }
          }
  
          // any atom which is adjacent to one (and only one) cyclic
          // pi bond contributes 1 electron
          for (int i = 0; i < n; i++) {
              electrons[i] = piBonds[i] == 1 ? 1 : -1;
          }
  
          return electrons;
      }
docs: {@inheritDoc}