static int indexOfHetro ( int [ ] cycle , int [ ] contribution ) { int index = - 1 ; for ( int i = 0 ; i < cycle . length - 1 ; i ++ ) { if ( contribution [ cycle [ i ] ] == 2 ) index = index == - 1 ? i : - 2 ; } return index ; }
Find the index of a hetroatom in a cycle . A hetroatom in MMFF is the unique atom that contributes a pi - lone - pair to the aromatic system .