Computing second cohomology of finite groups with trivial coefficients